Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
August 2018
- 62 participants
- 701 discussions
29 Aug '18
This saves the user from having to search for the hard to find start
of the (build) log.
Special care is taken to not disable word-based selection when
double-clicking on the log text itself. To switch back to the summary
view one must therefore double-click to the right of the end-of-line.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/JobDetails.pl | 41 +++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 37185eb1f..51fb2e9dd 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -252,7 +252,7 @@ sub InitMoreInfo($)
}
}
-sub GenerateMoreInfoLink($$$;$)
+sub GetMoreInfoLink($$$$;$)
{
my ($self, $LinkKey, $Label, $Set, $Value) = @_;
@@ -295,6 +295,14 @@ sub GenerateMoreInfoLink($$$;$)
}
}
$Url .= "#k" . uri_escape($LinkKey);
+ return ($Action, $Url);
+}
+
+sub GenerateMoreInfoLink($$$$;$)
+{
+ my ($self, $LinkKey, $Label, $Set, $Value) = @_;
+
+ my ($Action, $Url) = $self->GetMoreInfoLink($LinkKey, $Label, $Set, $Value);
my $Html = "<a href='". $self->CGI->escapeHTML($Url) ."'>$Action $Label</a>";
if ($Action eq "Hide")
@@ -309,9 +317,9 @@ sub GetErrorCategory($)
return "error";
}
-sub GenerateFullLog($$;$)
+sub GenerateFullLog($$$;$)
{
- my ($self, $FileName, $Header) = @_;
+ my ($self, $FileName, $HideLog, $Header) = @_;
my $GetCategory = $FileName =~ /\.err$/ ? \&GetErrorCategory :
$FileName =~ /\.report$/ ? \&GetReportLineCategory :
@@ -326,7 +334,7 @@ sub GenerateFullLog($$;$)
if ($IsEmpty)
{
print $Header if (defined $Header);
- print "<pre><code>";
+ print "<pre$HideLog><code>";
$IsEmpty = 0;
}
@@ -353,6 +361,23 @@ sub GenerateBody($)
$self->InitMoreInfo();
+ print <<EOF;
+<script type='text/javascript'>
+<!--
+function HideLog(event, url)
+{
+ // Ignore double-clicks on the log text (i.e. on the <code> element) to
+ // allow word-selection
+ if (event.target.nodeName == 'PRE' && !event.altKey && !event.ctrlKey &&
+ !event.metaKey && !event.shiftKey)
+ {
+ window.open(url, "_self", "", true);
+ }
+}
+//-->
+</script>
+EOF
+
print "<div class='Content'>\n";
my $Keys = $self->SortKeys(undef, $self->{Collection}->GetKeys());
foreach my $Key (@$Keys)
@@ -397,7 +422,11 @@ sub GenerateBody($)
# Show this log in full, highlighting the important lines
#
- my $LogIsEmpty = $self->GenerateFullLog("$TaskDir/$MoreInfo->{Full}");
+ my ($Action, $Url) = $self->GetMoreInfoLink($Key, GetLogLabel($MoreInfo->{Full}), "Full", $MoreInfo->{Full});
+ $Url = $self->CGI->escapeHTML($Url);
+ my $HideLog = $Action eq "Hide" ? " ondblclick='HideLog(event, \"$Url\")'" : "";
+
+ my $LogIsEmpty = $self->GenerateFullLog("$TaskDir/$MoreInfo->{Full}", $HideLog);
my $EmptyDiag;
if ($LogIsEmpty)
{
@@ -420,7 +449,7 @@ sub GenerateBody($)
my $ErrHeader = $MoreInfo->{Full} =~ /\.report/ ? "report" : "task";
$ErrHeader = "old $ErrHeader" if ($MoreInfo->{Full} =~ /^old_/);
$ErrHeader = "<div class='HrTitle'>". ucfirst($ErrHeader) ." errors<div class='HrLine'></div></div>";
- my $ErrIsEmpty = $self->GenerateFullLog("$TaskDir/$MoreInfo->{Full}.err", $ErrHeader);
+ my $ErrIsEmpty = $self->GenerateFullLog("$TaskDir/$MoreInfo->{Full}.err", $HideLog, $ErrHeader);
print $EmptyDiag if ($ErrIsEmpty and defined $EmptyDiag);
}
else
--
2.18.0
1
0
Hello guys,
I have pushed wine-3.0.3-rc1 (with tag) to
https://github.com/mstefani/wine-stable/tree/stable
http://static-winehq.193b.starter-ca-central-1.openshiftapps.com/stable/
Still nothing fancy so going straight to the interesting pieces from the
ANNOUNCE file:
What's new in this release (see below for details):
- Various bug fixes
----------------------------------------------------------------
Bugs fixed in 3.0.3 (total 53):
18164 dlls/iphlpapi/ifenum.c: compiler warnings on NetBSD
18734 DlgDirList(DDL_DRIVES|DDL_DIRECTORY) on 16-bits displays files
on listbox in Windows but not Wine.
21404 winedbg does not support fixed host:port parameter
24374 Driller crashes in process PE entry point due to Wine's
mis-align workaround for 32-bit entry point asm wrapper (MoleBox Ultra v4.x)
24641 ProPresenter 4.x (.NET 3.5 WPF app) fails on startup (devenum
CreateInstance() doesn't support IID_IUnknown)
27497 Regedit mangles registry keys containing embedded NULLs
30713 Microsoft Visual C++ 64-bit redistributables get incorrectly
installed into SysWOW64 (system directory for 32-bit files) when run
under 64-bit Wine
32907 AMMYY Admin v3.0 crashes at startup in Win7 mode
('NtSetInformationToken' needs to support 'TokenSessionId')
34910 WinLaunch 0.4.x (OSX Style free Launcher) complains about
missing "%USERPROFILE%\\Application Data\\Microsoft\\Windows\\Themes\\"
directory
35928 Crash handlers/debuggers fail to display user-interface when
invoked for crashing (non-interactive) service processes (inherited Wine
service window station/desktop)
38849 valgrind shows an uninitialized variable in
programs/cmd/tests/batch.c:WCMD_assoc
38886 AArch64 platforms: ABI Problems wrt varargs (needs arm64
specific __builtin_ms_va_list)
39078 Visual Pinball 8.x, 9.x, 10.x crash on exit after creating a
new table, needs support for VBScript IActiveScriptDebug
40271 Can't start UPlay: "Connection Lost" error
40694 Invalid behavior of "C: && echo haha" or "C: & echo haha"
40742 cmd.exe: buffer overflow while parsing qualifiers
42304 Caladrius Blaze, Raiden IV: Overkill show black screen on title
menu (needs native vcrun2013)
42599 Max Payne 3 (Steam) crashes in DX9 mode
42602 ::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct) bad sort
compared to Windows
42669 SolveigMM Video Splitter Business Edition v6.1: Crashes inside
gdi32.GetCharacterPlacementW
43300 wchar.h missing wmemchr, wmemcmp, wmemcpy, wmemmove, and wmemset
43607 Akiba's Trip Undead & Undressed requires MFStartup to return S_OK.
44001 Empire of the Ants (french version "les fourmis") - game crashed
44334 'start /W "" notepad' does not wait as on native.
44399 WickrMe 4.19.7: Crashes due to stub combase.RoGetActivationFactory
44845 Bankperfect plugin installater Echéancier hangs during install
44895 League Of Legends: Unable to log in if behind OpenWRT based router
44952 cmd.exe skips statements after if statement inside for loop
44953 Adobe Premiere Elements 14 (trial) crashes inside winmm.dll
44976 ConEmu-Maximus5 Windows console emulator causes crash of
builtin 'wineconsole.exe' (division by zero)
45051 cmd.exe for loop does not resolve wildcards with subdirectory
45067 UNORM/SNORM immediate constants not supported for UAV stores
(Claybook, Just Cause 3)
45078 UFOHD2 crashes inside devenum
45081 DsEnumerateDomainTrusts stubbed without A/W suffix
45118 Microsoft Windows PowerShell 6.x reports 'PowerShell Gallery is
currently unavailable.' (WinHttpSetOption returns incorrect lasterror on
unsupported options)
45143 Neoncron 2 Launcher crashes embedding IE browser process when
clicking bottom menu items
45170 Cygwin/MSYS2 needs EXDEV error code mapped to
STATUS_NOT_SAME_DEVICE (rename of cross-device links)
45179 iTunes 12.x installer freezes at the final step
45220 Regression: Hearthstone-Deck-Tracker stoped working after wine-2.21
45243 Wrong cast in some HANDLE_MSG_WM_* macros produces errors when
compiling with wineg++
45274 Multiple applications crash on unimplemented function
msvcp140.dll.?_Syserror_map(a)std@@YAPEBDH(a)Z (Native Instruments Traktor
Pro 2)
45299 Adobe flash player online installer fails the download
45317 updating wine mono does not change version in uninstaller.exe
45333 Add diagnostic 'mscoree.dll.CorIsLatestSvc' stub (NGEN service)
to hint at broken Microsoft .NET Frameworks installation (Wine-Mono not
uninstalled and/or 'mscoree.dll' placeholders not removed prior install)
45359 SHGetKnownFolderPath doesn't handle flag KF_FLAG_DONT_UNEXPAND
45378 vSphere 5.5 client 'hcmon.sys' driver crashes on unimplemented
function ntoskrnl.exe.IoUnregisterPlugPlayNotification
45387 arm64_map_dwarf_register: Don't know how to map register (64-66)
45393 TextureCookerService.exe (part of ArcGIS Desktop 10.6) needs
api-ms-win-crt-stdio-l1-1-0.dll.gets_s
45394 Reinstalling ArcGIS Desktop 10.6 calls unimplemented function
msvcr120.dll._SetWinRTOutOfMemoryExceptionCallback
45403 dwarf2_parse_variable(): Assertion `subpgm->func' failed
45428 Crash Bandicoot N. Sane Trilogy (Steam) crashes while entering
main menu in ntdll.NtGetContextThread() with NULL context
45439 Visual Basic setup toolkit fails to run if path contains a
voiced Katakana character.
45445 1C:Enterprise 8 platform doesn't install
----------------------------------------------------------------
Changes since 3.0.2:
Akihiro Sagawa (2):
kernel32/tests: Add more LCMapString tests.
kernel32: Fix LCMapString(LCMAP_HALFWIDTH) in some cases.
Alex Henrie (9):
comctl32/listview: Don't invalidate when new style is same as old.
include: Add wmemchr to wchar.h.
include: Add wmemcmp to wchar.h.
include: Add wmemcpy to wchar.h.
include: Add wmemmove to wchar.h.
include: Add wmemset to wchar.h.
iphlpapi: Cast caddr_t to char* before doing pointer arithmetic.
gdi32: Add DECLSPEC_HOTPATCH to GetDIBits.
gdi32: Fix memory leak on error in PATH_WidenPath (Coverity).
Alex Villacís Lasso (1):
user.exe16: Fix handling of DDL_DRIVES flag in DlgDirList.
Alexandre Julliard (3):
winex11: Don't allocate a window surface for off-screen windows.
winex11: Support using an ARGB visual as default visual.
winex11: Use the client window support also for XComposite child
windows.
Alistair Leslie-Hughes (4):
msvcrtd: Forward operator_new_dbg to msvcrt.
mfplat: Return S_OK from MFStartup stub.
combase/tests: Add RoGetActivationFactory tests.
netapi32: Add DsEnumerateDomainTrustsA/W stubs.
André Hentschel (3):
dbghelp: Recompute location after fixing it.
dbghelp: Map SIMD dwarf registers on ARM64.
winedbg: Check for visible window station before displaying crash
dialog.
Austin English (1):
winecfg: Recommend against overriding secur32.
Bernhard Übelacker (1):
cmd: Avoid having first parameter to start.exe ignored.
Dmitry Timoshkov (4):
user32/tests: Add a test for WM_MEASUREITEM when inserting an item
to an owner-drawn listbox.
user32/tests: Add a message test for an owner-drawn sorted listbox.
user32: Fix order of items passed in WM_COMPAREITEM data.
user32: Fix the listbox sorting algorithm.
Fabian Maurer (2):
wineconsole: When loading settings for an application, respect a 0
in FontSize.
wrc: Don't crash when parsing COMBOBOX element without style.
Hans Leidekker (4):
ws2_32: Enable IP_DONTFRAGMENT by default for SOCK_STREAM sockets.
winhttp: Fix invalid option error returned from WinHttpSetOption.
winhttp: Store the server certificate context in the request.
webservices: Avoid a warning from HeapDestroy.
Hugh McMaster (2):
regedit/tests: Add tests for values with embedded null characters.
regedit: Stop exporting REG_SZ data at the first NUL character.
Jason Edmeades (5):
cmd: Fix issue in WCMD_assoc highlighted by valgrind.
cmd: Support "c:<space>" etc when changing drive letters.
cmd: Fix subdirectory prefix in for loops.
cmd: Expand the storage space for qualifiers.
cmd: Fix statements after 'else' inside for loops.
Johannes Brandstätter (1):
ntdll: Check for NULL context in NtGetContextThread.
Józef Kucia (4):
shell32: Accept more flags in SHGetKnownFolderPath().
wined3d: Fix snorm/unorm immediate values for UAV writes.
wined3d: Add GPU information for AMD Radeon RX Vega.
wined3d: Add GPU information for Intel HD Graphics 630.
Louis Lenders (4):
winmm: Return error in waveOutMessage if either dwParam1 or
dwParam2 is null.
winmm: Return error in waveInMessage if either dwParam1 or
dwParam2 is null.
mscoree: Add stub for CorIsLatestSvc to hint user at broken .NET
installation.
ntoskrnl.exe: Add stub for IoUnregisterPlugPlayNotification.
Marcos Gutierrez (1):
include: Fixed casts in some HANDLE_MSG_WM_* macros.
Martin Storsjo (1):
arm64: Use __builtin_ms_va_list and __attribute__((ms_abi)) on arm64.
Matej Špindler (1):
kernel32: Check for LOCALE_NOUSEROVERRIDE for neutral locales.
Michael Müller (9):
include: Add activation.idl with IActivationFactory interface.
include/roapi.h: Add further typedefs.
combase: Implement RoGetActivationFactory.
combase: Implement RoActivateInstance.
secur32: Set output buffer size to zero during handshake when no
data needs to be sent.
ntdll: Return success for TokenSessionId in NtSetInformationToken.
dxdiagn: Add several more fields for DisplayDevices.
gdi32: Treat lpResults as optional in GetCharacterPlacement.
msvcr120: Add stub for _SetWinRTOutOfMemoryExceptionCallback.
Nikolay Sivov (2):
comctl32/trackbar: Don't update page size if it was explicitly set.
comctl32/trackbar: Fix reseting to default page size.
Piotr Caban (5):
msvcr80: Add gets_s implementation.
include/msvcrt: Add POSIX error codes to errno.h.
msvcp110: Add _Syserror_map implementation.
msvcp90: Don't set failbit in basic_istream::tellg.
msi: Fix condition evaluation when comparing literal and integer.
Qian Hong (1):
server: Map EXDEV to STATUS_NOT_SAME_DEVICE.
Sebastian Lackner (2):
shell32: Create Microsoft\Windows\Themes directory during prefix
creation.
kernel32: Fill stack with meaningful values in call_process_entry
mis-align workaround.
Vincent Povirk (3):
mscoree: Use upgrade code to find installed Wine Mono version.
gdi32: Check for truncated EMF files.
gdi32: Check that emf records are within the file.
Zebediah Figura (9):
winedbg: Add support for starting on a user-supplied port.
msi: Disable WoW redirection when installing a 64-bit package.
devenum/tests: Test all registered categories.
devenum: Check for null pointer in IMoniker_BindToObject().
jscript: Avoid crash when calling stringify() with no arguments.
advapi32: Correctly translate SERVICE_REQUIRED_PRIVILEGES_INFO to RPC.
vbscript: Add stub IActiveScriptDebug interface.
devenum: Merge factory.c into devenum_main.c.
devenum: Use separate factories for CLSID_SystemDeviceEnum and
CLSID_CDeviceMoniker.
Zhiyi Zhang (1):
gdiplus: Fix a memory leak.
--
Michael Stefaniuc
mstefani(a)winehq.org
1
0
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/oleaut32/oleaut.c | 6 +--
dlls/oleaut32/olefont.c | 4 +-
dlls/oleaut32/olepicture.c | 2 +-
dlls/oleaut32/tmarshal.c | 12 +++---
dlls/oleaut32/typelib.c | 8 ++--
dlls/oleaut32/varformat.c | 66 +++++++++++------------------
dlls/oleaut32/variant.c | 4 +-
dlls/oleaut32/vartype.c | 103 +++++++++++++++++++++------------------------
8 files changed, 90 insertions(+), 115 deletions(-)
diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c
index d03893a938..20e8d73318 100644
--- a/dlls/oleaut32/oleaut.c
+++ b/dlls/oleaut32/oleaut.c
@@ -122,9 +122,7 @@ static inline bstr_t *bstr_from_str(BSTR str)
static inline bstr_cache_entry_t *get_cache_entry_from_idx(unsigned cache_idx)
{
- return bstr_cache_enabled && cache_idx < sizeof(bstr_cache)/sizeof(*bstr_cache)
- ? bstr_cache + cache_idx
- : NULL;
+ return bstr_cache_enabled && cache_idx < ARRAY_SIZE(bstr_cache) ? bstr_cache + cache_idx : NULL;
}
static inline bstr_cache_entry_t *get_cache_entry(size_t size)
@@ -304,7 +302,7 @@ void WINAPI SysFreeString(BSTR str)
}
}
- if(cache_entry->cnt < sizeof(cache_entry->buf)/sizeof(*cache_entry->buf)) {
+ if(cache_entry->cnt < ARRAY_SIZE(cache_entry->buf)) {
cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
cache_entry->cnt++;
diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index c20093c702..9628dc091e 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -591,7 +591,7 @@ static void realize_font(OLEFontImpl *This)
if(This->gdiFont)
{
old_font = SelectObject(hdc, This->gdiFont);
- GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face);
+ GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
SelectObject(hdc, old_font);
dec_int_ref(This->gdiFont);
This->gdiFont = 0;
@@ -645,7 +645,7 @@ static void realize_font(OLEFontImpl *This)
/* Fixup the name and charset properties so that they match the
selected font */
old_font = SelectObject(get_dc(), This->gdiFont);
- GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face);
+ GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
if(lstrcmpiW(text_face, This->description.lpstrName))
{
HeapFree(GetProcessHeap(), 0, This->description.lpstrName);
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 0ef0ecfeb6..03fd6cf521 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -2395,7 +2395,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
if (strncmpW(szURLorPath, file, 5) == 0) {
DWORD size;
hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf,
- sizeof(path_buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(path_buf), &size, 0);
if (FAILED(hRes))
return hRes;
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index e0e1e083c4..1e1688e690 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -387,8 +387,8 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo **typeinfo)
*typeinfo = NULL;
moduleW[0] = 0;
- if (!actctx_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0]))) {
- hres = reg_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0]));
+ if (!actctx_get_typelib_module(riid, moduleW, ARRAY_SIZE(moduleW))) {
+ hres = reg_get_typelib_module(riid, moduleW, ARRAY_SIZE(moduleW));
if (FAILED(hres))
return hres;
}
@@ -1470,9 +1470,9 @@ static DWORD WINAPI xCall(int method, void **args)
/* Need them for hack below */
memset(names,0,sizeof(names));
- if (ITypeInfo_GetNames(tinfo,fdesc->memid,names,sizeof(names)/sizeof(names[0]),&nrofnames))
+ if (ITypeInfo_GetNames(tinfo,fdesc->memid,names,ARRAY_SIZE(names),&nrofnames))
nrofnames = 0;
- if (nrofnames > sizeof(names)/sizeof(names[0]))
+ if (nrofnames > ARRAY_SIZE(names))
ERR("Need more names!\n");
xargs = (DWORD *)(args + 1);
@@ -2125,8 +2125,8 @@ TMStubImpl_Invoke(
/* Need them for hack below */
memset(names,0,sizeof(names));
- ITypeInfo_GetNames(tinfo,fdesc->memid,names,sizeof(names)/sizeof(names[0]),&nrofnames);
- if (nrofnames > sizeof(names)/sizeof(names[0])) {
+ ITypeInfo_GetNames(tinfo,fdesc->memid,names,ARRAY_SIZE(names),&nrofnames);
+ if (nrofnames > ARRAY_SIZE(names)) {
ERR("Need more names!\n");
}
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index b907c96699..2c0a519679 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -328,7 +328,7 @@ static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin,
return TYPE_E_LIBNOTREGISTERED;
nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset);
- len = SearchPathW( NULL, nameW, NULL, sizeof(Path)/sizeof(WCHAR), Path, NULL );
+ len = SearchPathW( NULL, nameW, NULL, ARRAY_SIZE( Path ), Path, NULL );
if (!len) return TYPE_E_LIBNOTREGISTERED;
TRACE_(typelib)("got path from context %s\n", debugstr_w(Path));
@@ -969,11 +969,11 @@ enddeleteloop:
/* check if there is anything besides the FLAGS/HELPDIR keys.
If there is, we don't delete them */
- tmpLength = sizeof(subKeyName)/sizeof(WCHAR);
+ tmpLength = ARRAY_SIZE(subKeyName);
deleteOtherStuff = TRUE;
i = 0;
while(RegEnumKeyExW(key, i++, subKeyName, &tmpLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
- tmpLength = sizeof(subKeyName)/sizeof(WCHAR);
+ tmpLength = ARRAY_SIZE(subKeyName);
/* if its not FLAGS or HELPDIR, then we must keep the rest of the key */
if (!strcmpW(subKeyName, FLAGSW)) continue;
@@ -7751,7 +7751,7 @@ static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lp
if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH)))
return TRUE;
- if (snprintfW(szPath + len, sizeof(szPath)/sizeof(WCHAR) - len, formatW, LOWORD(lpszName)) < 0)
+ if (snprintfW(szPath + len, ARRAY_SIZE(szPath) - len, formatW, LOWORD(lpszName)) < 0)
return TRUE;
ret = LoadTypeLibEx(szPath, REGKIND_NONE, &pTLib);
diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index 696763e7ed..470ea4e01b 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -449,8 +449,7 @@ static inline const BYTE *VARIANT_GetNamedFormat(LPCWSTR lpszFormat)
LPCNAMED_FORMAT fmt;
key.name = lpszFormat;
- fmt = bsearch(&key, VARIANT_NamedFormats,
- sizeof(VARIANT_NamedFormats)/sizeof(NAMED_FORMAT),
+ fmt = bsearch(&key, VARIANT_NamedFormats, ARRAY_SIZE(VARIANT_NamedFormats),
sizeof(NAMED_FORMAT), FormatCompareFn);
return fmt ? fmt->format : NULL;
}
@@ -764,7 +763,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
TRACE("time sep\n");
}
else if ((*pFormat == 'a' || *pFormat == 'A') &&
- !strncmpiW(pFormat, szAMPM, sizeof(szAMPM)/sizeof(WCHAR)))
+ !strncmpiW(pFormat, szAMPM, ARRAY_SIZE(szAMPM)))
{
/* Date formats: System AM/PM designation
* Other formats: Literal
@@ -772,8 +771,8 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
*/
header->type = FMT_TYPE_DATE;
NEED_SPACE(sizeof(BYTE));
- pFormat += sizeof(szAMPM)/sizeof(WCHAR);
- if (!strncmpW(pFormat, szampm, sizeof(szampm)/sizeof(WCHAR)))
+ pFormat += ARRAY_SIZE(szAMPM);
+ if (!strncmpW(pFormat, szampm, ARRAY_SIZE(szampm)))
*pOut++ = FMT_DATE_AMPM_SYS2;
else
*pOut++ = FMT_DATE_AMPM_SYS1;
@@ -811,8 +810,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
*pLastHours = *pLastHours + 2;
TRACE("A/P\n");
}
- else if (*pFormat == 'a' &&
- !strncmpW(pFormat, szamSlashpm, sizeof(szamSlashpm)/sizeof(WCHAR)))
+ else if (*pFormat == 'a' && !strncmpW(pFormat, szamSlashpm, ARRAY_SIZE(szamSlashpm)))
{
/* Date formats: lowercase AM or PM designation
* Other formats: Literal
@@ -820,14 +818,13 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
*/
header->type = FMT_TYPE_DATE;
NEED_SPACE(sizeof(BYTE));
- pFormat += sizeof(szamSlashpm)/sizeof(WCHAR);
+ pFormat += ARRAY_SIZE(szamSlashpm);
*pOut++ = FMT_DATE_AMPM_LOWER;
if (pLastHours)
*pLastHours = *pLastHours + 2;
TRACE("AM/PM\n");
}
- else if (*pFormat == 'A' &&
- !strncmpW(pFormat, szAMSlashPM, sizeof(szAMSlashPM)/sizeof(WCHAR)))
+ else if (*pFormat == 'A' && !strncmpW(pFormat, szAMSlashPM, ARRAY_SIZE(szAMSlashPM)))
{
/* Date formats: Uppercase AM or PM designation
* Other formats: Literal
@@ -835,7 +832,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
*/
header->type = FMT_TYPE_DATE;
NEED_SPACE(sizeof(BYTE));
- pFormat += sizeof(szAMSlashPM)/sizeof(WCHAR);
+ pFormat += ARRAY_SIZE(szAMSlashPM);
*pOut++ = FMT_DATE_AMPM_UPPER;
TRACE("AM/PM\n");
}
@@ -847,7 +844,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
*/
header->type = FMT_TYPE_DATE;
NEED_SPACE(sizeof(BYTE));
- pFormat += sizeof(szAMSlashPM)/sizeof(WCHAR);
+ pFormat += ARRAY_SIZE(szAMSlashPM);
*pOut++ = FMT_DATE_GENERAL;
TRACE("gen date\n");
}
@@ -989,14 +986,14 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
fmt_state &= ~FMT_STATE_OPEN_COPY;
}
else if ((*pFormat == 't' || *pFormat == 'T') &&
- !strncmpiW(pFormat, szTTTTT, sizeof(szTTTTT)/sizeof(WCHAR)))
+ !strncmpiW(pFormat, szTTTTT, ARRAY_SIZE(szTTTTT)))
{
/* Date formats: System time specifier
* Other formats: Literal
* Types the format if found
*/
header->type = FMT_TYPE_DATE;
- pFormat += sizeof(szTTTTT)/sizeof(WCHAR);
+ pFormat += ARRAY_SIZE(szTTTTT);
NEED_SPACE(sizeof(BYTE));
*pOut++ = FMT_DATE_TIME_SYS;
fmt_state &= ~FMT_STATE_OPEN_COPY;
@@ -1316,8 +1313,7 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
if (numHeader->flags & FMT_FLAG_THOUSANDS)
{
- if (!GetLocaleInfoW(lcid, LOCALE_STHOUSAND, thousandSeparator,
- sizeof(thousandSeparator)/sizeof(WCHAR)))
+ if (!GetLocaleInfoW(lcid, LOCALE_STHOUSAND, thousandSeparator, ARRAY_SIZE(thousandSeparator)))
{
thousandSeparator[0] = ',';
thousandSeparator[1] = 0;
@@ -1555,8 +1551,7 @@ VARIANT_FormatNumber_Bool:
}
if (localeValue)
{
- if (GetLocaleInfoW(lcid, localeValue, pBuff,
- sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
+ if (GetLocaleInfoW(lcid, localeValue, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
{
TRACE("added %s\n", debugstr_w(pBuff));
while (*pBuff)
@@ -1875,8 +1870,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
if (localeValue)
{
*pBuff = '\0';
- if (GetLocaleInfoW(lcid, localeValue, pBuff,
- sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
+ if (GetLocaleInfoW(lcid, localeValue, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
{
TRACE("added %s\n", debugstr_w(pBuff));
while (*pBuff)
@@ -1892,9 +1886,8 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
{
WCHAR fmt_buff[80];
- if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
- !get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff,
- sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
+ if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, ARRAY_SIZE(fmt_buff)) ||
+ !get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
{
hRes = E_INVALIDARG;
goto VARIANT_FormatDate_Exit;
@@ -2293,8 +2286,7 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT
{
WCHAR grouping[16];
grouping[2] = '\0';
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping,
- sizeof(grouping)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping));
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
}
else if (nGrouping == -1)
@@ -2310,14 +2302,11 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT
numfmt.NegativeOrder = 1; /* 1 = "-xxx" */
numfmt.lpDecimalSep = decimal;
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal,
- sizeof(decimal)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, ARRAY_SIZE(decimal));
numfmt.lpThousandSep = thousands;
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands,
- sizeof(thousands)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands, ARRAY_SIZE(thousands));
- if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,
- buff, sizeof(buff)/sizeof(WCHAR)))
+ if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff)))
{
*pbstrOut = SysAllocString(buff);
if (!*pbstrOut)
@@ -2473,8 +2462,7 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
{
WCHAR grouping[16];
grouping[2] = '\0';
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping,
- sizeof(grouping)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping));
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
}
else if (nGrouping == -1)
@@ -2492,18 +2480,14 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
GETLOCALENUMBER(LOCALE_ICURRENCY, PositiveOrder);
numfmt.lpDecimalSep = decimal;
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal,
- sizeof(decimal)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, ARRAY_SIZE(decimal));
numfmt.lpThousandSep = thousands;
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands,
- sizeof(thousands)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, ARRAY_SIZE(thousands));
numfmt.lpCurrencySymbol = currency;
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency,
- sizeof(currency)/sizeof(WCHAR));
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency, ARRAY_SIZE(currency));
/* use NLS as per VarFormatNumber() */
- if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,
- buff, sizeof(buff)/sizeof(WCHAR)))
+ if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff)))
{
*pbstrOut = SysAllocString(buff);
if (!*pbstrOut)
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index b9cf4b0a00..1fa2a6d6fa 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1549,7 +1549,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
/* Local currency symbols are often 2 characters */
lpChars->cCurrencyLocal2 = '\0';
- switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, sizeof(buff)/sizeof(WCHAR)))
+ switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, ARRAY_SIZE(buff)))
{
case 3: lpChars->cCurrencyLocal2 = buff[1]; /* Fall through */
case 2: lpChars->cCurrencyLocal = buff[0];
@@ -1610,7 +1610,7 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
VARIANT_NUMBER_CHARS chars;
BYTE rgbTmp[1024];
DWORD dwState = B_EXPONENT_START|B_INEXACT_ZEROS;
- int iMaxDigits = sizeof(rgbTmp) / sizeof(BYTE);
+ int iMaxDigits = ARRAY_SIZE(rgbTmp);
int cchUsed = 0;
TRACE("(%s,%d,0x%08x,%p,%p)\n", debugstr_w(lpszStr), lcid, dwFlags, pNumprs, rgbDig);
diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index 232a58fe27..e2df87328c 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -95,7 +95,7 @@ static HRESULT VARIANT_NumberFromBstr(OLECHAR* pStrIn, LCID lcid, ULONG ulFlags,
BYTE rgb[1024];
/* Use VarParseNumFromStr/VarNumFromParseNum as MSDN indicates */
- np.cDig = sizeof(rgb) / sizeof(BYTE);
+ np.cDig = ARRAY_SIZE(rgb);
np.dwInFlags = NUMPRS_STD;
hRet = VarParseNumFromStr(pStrIn, lcid, ulFlags, &np, rgb);
@@ -4496,15 +4496,15 @@ static HRESULT VARIANT_DecScale(const DECIMAL** ppDecLeft,
di.scale -= i;
remainder = 0;
- while (i-- > 0 && !VARIANT_int_iszero(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD)))
+ while (i-- > 0 && !VARIANT_int_iszero(di.bitsnum, ARRAY_SIZE(di.bitsnum)))
{
- remainder = VARIANT_int_divbychar(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD), 10);
+ remainder = VARIANT_int_divbychar(di.bitsnum, ARRAY_SIZE(di.bitsnum), 10);
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
}
/* round up the result - native oleaut32 does this */
if (remainder >= 5) {
- for (remainder = 1, i = 0; i < sizeof(di.bitsnum)/sizeof(DWORD) && remainder; i++) {
+ for (remainder = 1, i = 0; i < ARRAY_SIZE(di.bitsnum) && remainder; i++) {
ULONGLONG digit = di.bitsnum[i] + 1;
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
di.bitsnum[i] = digit & 0xFFFFFFFF;
@@ -4743,7 +4743,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
memset(running, 0, sizeof(running));
/* count number of leading zero-bytes in operand A */
- for (mulstart = sizeof(a->bitsnum)/sizeof(DWORD) - 1; mulstart >= 0 && !a->bitsnum[mulstart]; mulstart--);
+ for (mulstart = ARRAY_SIZE(a->bitsnum) - 1; mulstart >= 0 && !a->bitsnum[mulstart]; mulstart--);
if (mulstart < 0) {
/* result is 0, because operand A is 0 */
result->scale = 0;
@@ -4757,7 +4757,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
ULONG iOverflowMul;
int iB;
- for (iOverflowMul = 0, iB = 0; iB < sizeof(b->bitsnum)/sizeof(DWORD); iB++) {
+ for (iOverflowMul = 0, iB = 0; iB < ARRAY_SIZE(b->bitsnum); iB++) {
ULONG iRV;
int iR;
@@ -4789,11 +4789,10 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
This operation *will* lose significant digits of the result because
all the factors of 10 were consumed by the previous operation.
*/
- while (result->scale > 0 && !VARIANT_int_iszero(
- running + sizeof(result->bitsnum) / sizeof(DWORD),
- (sizeof(running) - sizeof(result->bitsnum)) / sizeof(DWORD))) {
-
- remainder = VARIANT_int_divbychar(running, sizeof(running) / sizeof(DWORD), 10);
+ while (result->scale > 0 && !VARIANT_int_iszero(running + ARRAY_SIZE(result->bitsnum),
+ ARRAY_SIZE(running) - ARRAY_SIZE(result->bitsnum))) {
+
+ remainder = VARIANT_int_divbychar(running, ARRAY_SIZE(running), 10);
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
result->scale--;
}
@@ -4801,7 +4800,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
/* round up the result - native oleaut32 does this */
if (remainder >= 5) {
unsigned int i;
- for (remainder = 1, i = 0; i < sizeof(running)/sizeof(DWORD) && remainder; i++) {
+ for (remainder = 1, i = 0; i < ARRAY_SIZE(running) && remainder; i++) {
ULONGLONG digit = running[i] + 1;
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
running[i] = digit & 0xFFFFFFFF;
@@ -4811,9 +4810,8 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
/* Signal overflow if scale == 0 and 256-bit result still overflows,
and copy result bits into result structure
*/
- r_overflow = !VARIANT_int_iszero(
- running + sizeof(result->bitsnum)/sizeof(DWORD),
- (sizeof(running) - sizeof(result->bitsnum))/sizeof(DWORD));
+ r_overflow = !VARIANT_int_iszero(running + ARRAY_SIZE(result->bitsnum),
+ ARRAY_SIZE(running) - ARRAY_SIZE(result->bitsnum));
memcpy(result->bitsnum, running, sizeof(result->bitsnum));
}
return r_overflow;
@@ -4831,7 +4829,7 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
unsigned int i;
/* place negative sign */
- if (!VARIANT_int_iszero(a->bitsnum, sizeof(a->bitsnum) / sizeof(DWORD)) && a->sign) {
+ if (!VARIANT_int_iszero(a->bitsnum, ARRAY_SIZE(a->bitsnum)) && a->sign) {
if (n > 0) {
*s++ = '-';
n--;
@@ -4849,8 +4847,8 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
i = 0;
memcpy(quotient, a->bitsnum, sizeof(a->bitsnum));
- while (!overflow && !VARIANT_int_iszero(quotient, sizeof(quotient) / sizeof(DWORD))) {
- remainder = VARIANT_int_divbychar(quotient, sizeof(quotient) / sizeof(DWORD), 10);
+ while (!overflow && !VARIANT_int_iszero(quotient, ARRAY_SIZE(quotient))) {
+ remainder = VARIANT_int_divbychar(quotient, ARRAY_SIZE(quotient), 10);
if (i + 2 > n) {
overflow = TRUE;
} else {
@@ -4859,7 +4857,7 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
}
}
- if (!overflow && !VARIANT_int_iszero(a->bitsnum, sizeof(a->bitsnum) / sizeof(DWORD))) {
+ if (!overflow && !VARIANT_int_iszero(a->bitsnum, ARRAY_SIZE(a->bitsnum))) {
/* reverse order of digits */
WCHAR * x = s; WCHAR * y = s + i - 1;
@@ -5175,10 +5173,10 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
{
HRESULT r_overflow = S_OK;
- if (VARIANT_int_iszero(divisor->bitsnum, sizeof(divisor->bitsnum)/sizeof(DWORD))) {
+ if (VARIANT_int_iszero(divisor->bitsnum, ARRAY_SIZE(divisor->bitsnum))) {
/* division by 0 */
r_overflow = DISP_E_DIVBYZERO;
- } else if (VARIANT_int_iszero(dividend->bitsnum, sizeof(dividend->bitsnum)/sizeof(DWORD))) {
+ } else if (VARIANT_int_iszero(dividend->bitsnum, ARRAY_SIZE(dividend->bitsnum))) {
VARIANT_DI_clear(quotient);
} else {
int quotientscale, remainderscale, tempquotientscale;
@@ -5208,17 +5206,14 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
memcpy(remainderplusquotient, dividend->bitsnum, sizeof(dividend->bitsnum));
do {
- VARIANT_int_div(
- remainderplusquotient, 4,
- divisor->bitsnum, sizeof(divisor->bitsnum)/sizeof(DWORD));
- underflow = VARIANT_int_addlossy(
- quotient->bitsnum, "ientscale, sizeof(quotient->bitsnum) / sizeof(DWORD),
- remainderplusquotient, &tempquotientscale, 4);
+ VARIANT_int_div(remainderplusquotient, 4, divisor->bitsnum, ARRAY_SIZE(divisor->bitsnum));
+ underflow = VARIANT_int_addlossy( quotient->bitsnum, "ientscale,
+ ARRAY_SIZE(quotient->bitsnum), remainderplusquotient, &tempquotientscale, 4);
if (round_remainder) {
if(remainderplusquotient[4] >= 5){
unsigned int i;
unsigned char remainder = 1;
- for (i = 0; i < sizeof(quotient->bitsnum) / sizeof(DWORD) && remainder; i++) {
+ for (i = 0; i < ARRAY_SIZE(quotient->bitsnum) && remainder; i++) {
ULONGLONG digit = quotient->bitsnum[i] + 1;
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
quotient->bitsnum[i] = digit & 0xFFFFFFFF;
@@ -5239,9 +5234,9 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
while (r_overflow == S_OK && quotientscale < 0) {
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
memcpy(remainderplusquotient, quotient->bitsnum, sizeof(quotient->bitsnum));
- VARIANT_int_mulbychar(remainderplusquotient, sizeof(remainderplusquotient)/sizeof(DWORD), 10);
- if (VARIANT_int_iszero(remainderplusquotient + sizeof(quotient->bitsnum)/sizeof(DWORD),
- (sizeof(remainderplusquotient) - sizeof(quotient->bitsnum))/sizeof(DWORD))) {
+ VARIANT_int_mulbychar(remainderplusquotient, ARRAY_SIZE(remainderplusquotient), 10);
+ if (VARIANT_int_iszero(remainderplusquotient + ARRAY_SIZE(quotient->bitsnum),
+ ARRAY_SIZE(remainderplusquotient) - ARRAY_SIZE(quotient->bitsnum))) {
quotientscale++;
memcpy(quotient->bitsnum, remainderplusquotient, sizeof(quotient->bitsnum));
} else r_overflow = DISP_E_OVERFLOW;
@@ -5562,9 +5557,9 @@ static HRESULT VARIANT_do_division(const DECIMAL *pDecLeft, const DECIMAL *pDecR
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
di_result.scale);
while (di_result.scale > DEC_MAX_SCALE &&
- !VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD)))
+ !VARIANT_int_iszero(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum)))
{
- remainder = VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD), 10);
+ remainder = VARIANT_int_divbychar(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum), 10);
di_result.scale--;
}
if (di_result.scale > DEC_MAX_SCALE)
@@ -5576,7 +5571,7 @@ static HRESULT VARIANT_do_division(const DECIMAL *pDecLeft, const DECIMAL *pDecR
else if (remainder >= 5) /* round up result - native oleaut32 does this */
{
unsigned int i;
- for (remainder = 1, i = 0; i < sizeof(di_result.bitsnum) / sizeof(DWORD) && remainder; i++) {
+ for (remainder = 1, i = 0; i < ARRAY_SIZE(di_result.bitsnum) && remainder; i++) {
ULONGLONG digit = di_result.bitsnum[i] + 1;
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
di_result.bitsnum[i] = digit & 0xFFFFFFFF;
@@ -5648,9 +5643,9 @@ HRESULT WINAPI VarDecMul(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
di_result.scale);
while (di_result.scale > DEC_MAX_SCALE &&
- !VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD)))
+ !VARIANT_int_iszero(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum)))
{
- VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD), 10);
+ VARIANT_int_divbychar(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum), 10);
di_result.scale--;
}
if (di_result.scale > DEC_MAX_SCALE)
@@ -6357,9 +6352,8 @@ static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut)
{
/* Format the number for the locale */
szConverted[0] = '\0';
- GetNumberFormatW(lcid,
- dwFlags & LOCALE_NOUSEROVERRIDE,
- szOut, NULL, szConverted, sizeof(szConverted)/sizeof(WCHAR));
+ GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
+ szOut, NULL, szConverted, ARRAY_SIZE(szConverted));
szOut = szConverted;
}
return SysAllocStringByteLen((LPCSTR)szOut, strlenW(szOut) * sizeof(WCHAR));
@@ -6368,7 +6362,7 @@ static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut)
/* Create a (possibly localised) BSTR from a UI8 and sign */
static HRESULT VARIANT_BstrFromUInt(ULONG64 ulVal, LCID lcid, DWORD dwFlags, BSTR *pbstrOut)
{
- WCHAR szBuff[64], *szOut = szBuff + sizeof(szBuff)/sizeof(WCHAR) - 1;
+ WCHAR szBuff[64], *szOut = szBuff + ARRAY_SIZE(szBuff) - 1;
if (!pbstrOut)
return E_INVALIDARG;
@@ -6472,7 +6466,7 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
appropriate NUMBERFMTW structure to do the job via GetNumberFormatW().
*/
GetLocaleInfoW(lcid, LOCALE_SDECIMAL | (dwFlags & LOCALE_NOUSEROVERRIDE),
- lpDecimalSep, sizeof(lpDecimalSep) / sizeof(WCHAR));
+ lpDecimalSep, ARRAY_SIZE(lpDecimalSep));
if (lpDecimalSep[0] == '.' && lpDecimalSep[1] == '\0')
{
/* locale is compatible with English - return original string */
@@ -6497,7 +6491,7 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
if (p) minFormat.NumDigits = strlenW(p + 1);
numbuff[0] = '\0';
- if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, sizeof(numbuff) / sizeof(WCHAR)))
+ if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, ARRAY_SIZE(numbuff)))
{
WARN("GetNumberFormatW() failed, returning raw number string instead\n");
bstrOut = SysAllocString(buff);
@@ -6541,7 +6535,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
/* Format the number for the locale */
numbuff[0] = '\0';
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
- buff, NULL, numbuff, sizeof(numbuff) / sizeof(WCHAR));
+ buff, NULL, numbuff, ARRAY_SIZE(numbuff));
TRACE("created NLS string %s\n", debugstr_w(numbuff));
*pbstrOut = SysAllocString(numbuff);
}
@@ -6632,7 +6626,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
VARIANT_int_add(decVal.bitsnum, 3, &one, 1);
}
decVal.bitsnum[2] = 0;
- VARIANT_DI_tostringW(&decVal, buff, sizeof(buff)/sizeof(buff[0]));
+ VARIANT_DI_tostringW(&decVal, buff, ARRAY_SIZE(buff));
if (dwFlags & LOCALE_USE_NLS)
{
@@ -6641,7 +6635,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
/* Format the currency for the locale */
cybuff[0] = '\0';
GetCurrencyFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
- buff, NULL, cybuff, sizeof(cybuff) / sizeof(WCHAR));
+ buff, NULL, cybuff, ARRAY_SIZE(cybuff));
*pbstrOut = SysAllocString(cybuff);
}
else
@@ -6814,8 +6808,8 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
if (dwFlags & VAR_TIMEVALUEONLY)
date[0] = '\0';
else
- if (!GetLocaleInfoW(lcid, LOCALE_SSHORTDATE, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
- !get_date_format(lcid, dwFlags, &st, fmt_buff, date, sizeof(date)/sizeof(WCHAR)))
+ if (!GetLocaleInfoW(lcid, LOCALE_SSHORTDATE, fmt_buff, ARRAY_SIZE(fmt_buff)) ||
+ !get_date_format(lcid, dwFlags, &st, fmt_buff, date, ARRAY_SIZE(date)))
return E_INVALIDARG;
if (!(dwFlags & VAR_DATEVALUEONLY))
@@ -6823,8 +6817,7 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
time = date + strlenW(date);
if (time != date)
*time++ = ' ';
- if (!GetTimeFormatW(lcid, dwFormatFlags, &st, NULL, time,
- sizeof(date)/sizeof(WCHAR)-(time-date)))
+ if (!GetTimeFormatW(lcid, dwFormatFlags, &st, NULL, time, ARRAY_SIZE(date)-(time-date)))
return E_INVALIDARG;
}
@@ -7012,7 +7005,7 @@ HRESULT WINAPI VarBstrFromDec(DECIMAL* pDecIn, LCID lcid, ULONG dwFlags, BSTR* p
/* Format the number for the locale */
numbuff[0] = '\0';
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
- buff, NULL, numbuff, sizeof(numbuff) / sizeof(WCHAR));
+ buff, NULL, numbuff, ARRAY_SIZE(numbuff));
TRACE("created NLS string %s\n", debugstr_w(numbuff));
*pbstrOut = SysAllocString(numbuff);
}
@@ -7625,7 +7618,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
1,2,3,4,5,6,7,8,9,10,11,12,13
};
unsigned int i;
- BSTR tokens[sizeof(ParseDateTokens)/sizeof(ParseDateTokens[0])];
+ BSTR tokens[ARRAY_SIZE(ParseDateTokens)];
DATEPARSE dp;
DWORD dwDateSeps = 0, iDate = 0;
HRESULT hRet = S_OK;
@@ -7648,7 +7641,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
TRACE("iDate is %d\n", iDate);
/* Get the month/day/am/pm tokens for this locale */
- for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tokens); i++)
{
WCHAR buff[128];
LCTYPE lctype = ParseDateTokens[i] | (dwFlags & LOCALE_NOUSEROVERRIDE);
@@ -7657,7 +7650,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
* GetAltMonthNames(). We should really cache these strings too.
*/
buff[0] = '\0';
- GetLocaleInfoW(lcid, lctype, buff, sizeof(buff)/sizeof(WCHAR));
+ GetLocaleInfoW(lcid, lctype, buff, ARRAY_SIZE(buff));
tokens[i] = SysAllocString(buff);
TRACE("token %d is %s\n", i, debugstr_w(tokens[i]));
}
@@ -7680,7 +7673,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
{
BOOL bFound = FALSE;
- for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tokens); i++)
{
DWORD dwLen = strlenW(tokens[i]);
if (dwLen && !strncmpiW(strIn, tokens[i], dwLen))
@@ -7940,7 +7933,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
}
}
- for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tokens); i++)
SysFreeString(tokens[i]);
return hRet;
}
--
2.14.4
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
include/Makefile.in | 4 ++
include/msopc.idl | 84 ++++++++++++++++++++++++++++++++++++++
include/opcbase.idl | 28 +++++++++++++
include/opcobjectmodel.idl | 34 +++++++++++++++
include/opcparturi.idl | 71 ++++++++++++++++++++++++++++++++
5 files changed, 221 insertions(+)
create mode 100644 include/msopc.idl
create mode 100644 include/opcbase.idl
create mode 100644 include/opcobjectmodel.idl
create mode 100644 include/opcparturi.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index a89fef6eac..ffecb98d9e 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -399,6 +399,7 @@ SOURCES = \
msident.idl \
msinkaut.idl \
msiquery.h \
+ msopc.idl \
mssip.h \
msstkppg.h \
mstask.idl \
@@ -493,6 +494,9 @@ SOURCES = \
oledberr.h \
oledlg.h \
oleidl.idl \
+ opcbase.idl \
+ opcobjectmodel.idl \
+ opcparturi.idl \
opnrst.idl \
optary.idl \
patchapi.h \
diff --git a/include/msopc.idl b/include/msopc.idl
new file mode 100644
index 0000000000..f60ff68712
--- /dev/null
+++ b/include/msopc.idl
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2018 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "unknwn.idl";
+import "ocidl.idl";
+
+import "opcbase.idl";
+import "opcobjectmodel.idl";
+import "opcparturi.idl";
+
+interface IOpcUri;
+interface IOpcPartUri;
+interface IOpcPackage;
+interface IOpcDigitalSignatureManager;
+
+[
+ object,
+ uuid(6d0b4446-cd73-4ab3-94f4-8ccdf6116154),
+ pointer_default(ref)
+]
+interface IOpcFactory : IUnknown
+{
+ HRESULT CreatePackageRootUri(
+ [out, retval] IOpcUri **uri
+ );
+
+ HRESULT CreatePartUri(
+ [in, string] LPCWSTR uri,
+ [out, retval] IOpcPartUri **part_uri
+ );
+
+ [local]
+ HRESULT CreateStreamOnFile(
+ [in, string] LPCWSTR filename,
+ [in] OPC_STREAM_IO_MODE io_mode,
+ [in, unique] SECURITY_ATTRIBUTES *sa,
+ [in] DWORD flags,
+ [out, retval] IStream **stream
+ );
+
+ HRESULT CreatePackage(
+ [out, retval] IOpcPackage **package
+ );
+
+ HRESULT ReadPackageFromStream(
+ [in] IStream *stream,
+ [in] OPC_READ_FLAGS flags,
+ [out, retval] IOpcPackage **package
+ );
+
+ HRESULT WritePackageToStream(
+ [in] IOpcPackage *package,
+ [in] OPC_WRITE_FLAGS flags,
+ [in] IStream *stream
+ );
+
+ HRESULT CreateDigitalSignatureManager(
+ [in] IOpcPackage *package,
+ [out, retval] IOpcDigitalSignatureManager **signature_manager
+ );
+}
+
+[
+ uuid(6b2d6Ba0-9f3e-4f27-920b-313cc426a39e)
+]
+coclass OpcFactory
+{
+ interface IOpcFactory;
+};
diff --git a/include/opcbase.idl b/include/opcbase.idl
new file mode 100644
index 0000000000..2cfb885c12
--- /dev/null
+++ b/include/opcbase.idl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2018 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#if 0
+#pragma makedep install
+#endif
+
+typedef [v1_enum] enum
+{
+ OPC_STREAM_IO_READ = 1,
+ OPC_STREAM_IO_WRITE = 2,
+} OPC_STREAM_IO_MODE;
+
diff --git a/include/opcobjectmodel.idl b/include/opcobjectmodel.idl
new file mode 100644
index 0000000000..e5370d2e54
--- /dev/null
+++ b/include/opcobjectmodel.idl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2018 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#if 0
+#pragma makedep install
+#endif
+
+typedef [v1_enum] enum
+{
+ OPC_READ_DEFAULT = 0,
+ OPC_VALIDATE_ON_LOAD = 1,
+ OPC_CACHE_ON_ACCESS = 2,
+} OPC_READ_FLAGS;
+
+typedef [v1_enum] enum
+{
+ OPC_WRITE_DEFAULT = 0,
+ OPC_WRITE_FORCE_ZIP32 = 1,
+} OPC_WRITE_FLAGS;
diff --git a/include/opcparturi.idl b/include/opcparturi.idl
new file mode 100644
index 0000000000..00b21b9598
--- /dev/null
+++ b/include/opcparturi.idl
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2018 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "unknwn.idl";
+import "ocidl.idl";
+
+#if 0
+#pragma makedep install
+#endif
+
+interface IOpcPartUri;
+
+[
+ object,
+ uuid(bc9c1b9b-d62c-49eb-aef0-3b4e0b28ebed),
+ nonextensible,
+ pointer_default(ref)
+]
+interface IOpcUri : IUri
+{
+ HRESULT GetRelationshipsPartUri(
+ [out, retval] IOpcPartUri **part_uri
+ );
+
+ HRESULT GetRelativeUri(
+ [in] IOpcPartUri *part_uri,
+ [out, retval] IUri **relative_uri
+ );
+
+ HRESULT CombinePartUri(
+ [in] IUri *relative_uri,
+ [out, retval] IOpcPartUri **combined
+ );
+}
+
+[
+ object,
+ uuid(7d3babe7-88b2-46ba-85cb-4203cb016c87),
+ nonextensible,
+ pointer_default(ref)
+]
+interface IOpcPartUri : IOpcUri
+{
+ HRESULT ComparePartUri(
+ [in] IOpcPartUri *part_uri,
+ [out, retval] INT32 *result
+ );
+
+ HRESULT GetSourceUri(
+ [out, retval] IOpcUri **source_uri
+ );
+
+ HRESULT IsRelationshipsPartUri(
+ [out, retval] BOOL *result
+ );
+}
--
2.18.0
1
0
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
dlls/winevulkan/vulkan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index 89df838f04..01c84ed6fe 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -743,6 +743,7 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
if ((app_info = create_info->pApplicationInfo) && app_info->pApplicationName)
{
if (!strcmp(app_info->pApplicationName, "DOOM")
+ || !strcmp(app_info->pApplicationName, "DOOM_VFR")
|| !strcmp(app_info->pApplicationName, "Wolfenstein II The New Colossus"))
object->quirks |= WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR;
}
--
2.18.0
2
1
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/button.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c
index db8d2b0156..b27ab844b7 100644
--- a/dlls/comctl32/tests/button.c
+++ b/dlls/comctl32/tests/button.c
@@ -32,8 +32,9 @@
static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR);
static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM);
-static HIMAGELIST(WINAPI *pImageList_Create)(int, int, UINT, int, int);
-static int(WINAPI *pImageList_Add)(HIMAGELIST, HBITMAP, HBITMAP);
+static HIMAGELIST (WINAPI *pImageList_Create)(int, int, UINT, int, int);
+static int (WINAPI *pImageList_Add)(HIMAGELIST, HBITMAP, HBITMAP);
+static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST);
/****************** button message test *************************/
#define ID_BUTTON 0x000e
@@ -82,6 +83,7 @@ static void init_functions(void)
#define X(f) p##f = (void *)GetProcAddress(hmod, #f);
X(ImageList_Create);
X(ImageList_Add);
+ X(ImageList_Destroy);
#undef X
}
@@ -1352,6 +1354,8 @@ static void test_get_set_imagelist(void)
DestroyWindow(hwnd);
}
+
+ pImageList_Destroy(himl);
}
static void test_get_set_textmargin(void)
--
2.18.0
1
0
[PATCH 4/5] msi: Handle the remote case in MsiSummaryInfoGetProperty.
by Dmitry Timoshkov 29 Aug '18
by Dmitry Timoshkov 29 Aug '18
29 Aug '18
This patch fixes the regression introduced by bf5589311de8ac2c74e3bd73bef32337a2ce8df2.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/msi/suminfo.c | 58 +++++++++++++++++++++++++++++++++++++++++
dlls/msi/tests/custom.c | 7 -----
dlls/msi/winemsi.idl | 2 ++
3 files changed, 60 insertions(+), 7 deletions(-)
diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index af8b03cacd..2045123c42 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -725,7 +725,27 @@ UINT WINAPI MsiSummaryInfoGetPropertyA(
}
if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO )))
+ {
+ MSIHANDLE remote;
+
+ if ((remote = msi_get_remote( handle )))
+ {
+ WCHAR *buf = NULL;
+
+ /* FIXME: should use SEH */
+ if (!puiDataType || !piValue || !pftValue || !szValueBuf || !pcchValueBuf)
+ return RPC_X_NULL_REF_POINTER;
+
+ r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf );
+ if (!r)
+ r = msi_strncpyWtoA( buf, -1, szValueBuf, pcchValueBuf, TRUE );
+
+ midl_user_free( buf );
+ return r;
+ }
+
return ERROR_INVALID_HANDLE;
+ }
str.unicode = FALSE;
str.str.a = szValueBuf;
@@ -753,7 +773,27 @@ UINT WINAPI MsiSummaryInfoGetPropertyW(
}
if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO )))
+ {
+ MSIHANDLE remote;
+
+ if ((remote = msi_get_remote( handle )))
+ {
+ WCHAR *buf = NULL;
+
+ /* FIXME: should use SEH */
+ if (!puiDataType || !piValue || !pftValue || !szValueBuf || !pcchValueBuf)
+ return RPC_X_NULL_REF_POINTER;
+
+ r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf );
+ if (!r)
+ r = msi_strncpyW( buf, -1, szValueBuf, pcchValueBuf );
+
+ midl_user_free( buf );
+ return r;
+ }
+
return ERROR_INVALID_HANDLE;
+ }
str.unicode = TRUE;
str.str.w = szValueBuf;
@@ -1134,3 +1174,21 @@ UINT __cdecl s_remote_SummaryInfoGetPropertyCount( MSIHANDLE suminfo, UINT *coun
{
return MsiSummaryInfoGetPropertyCount( suminfo, count );
}
+
+UINT __cdecl s_remote_SummaryInfoGetProperty( MSIHANDLE suminfo, UINT property, UINT *type,
+ INT *value, FILETIME *ft, LPWSTR *buf )
+{
+ WCHAR empty[1];
+ DWORD size = 0;
+ UINT r;
+
+ r = MsiSummaryInfoGetPropertyW( suminfo, property, type, value, ft, empty, &size );
+ if (r == ERROR_MORE_DATA)
+ {
+ size++;
+ *buf = midl_user_allocate( size * sizeof(WCHAR) );
+ if (!*buf) return ERROR_OUTOFMEMORY;
+ r = MsiSummaryInfoGetPropertyW( suminfo, property, type, value, ft, *buf, &size );
+ }
+ return r;
+}
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index eb0ed625ef..a727bbd4df 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -464,7 +464,6 @@ static void test_db(MSIHANDLE hinst)
ok(hinst, count == 5, "got %u\n", count);
r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL);
-todo_wine
ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
type = 0xdeadbeef;
@@ -472,11 +471,8 @@ todo_wine
strcpy(buffer, "deadbeef");
sz = sizeof(buffer);
r = MsiSummaryInfoGetPropertyA(suminfo, PID_AUTHOR, &type, &int_value, &ft, buffer, &sz);
-todo_wine
ok(hinst, !r, "got %u\n", r);
-todo_wine
ok(hinst, type == 0, "got %u\n", type);
-todo_wine
ok(hinst, int_value == 0, "got %u\n", int_value);
ok(hinst, sz == sizeof(buffer), "got %u\n", sz);
ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer);
@@ -486,11 +482,8 @@ todo_wine
strcpy(buffer, "deadbeef");
sz = sizeof(buffer);
r = MsiSummaryInfoGetPropertyA(suminfo, PID_CODEPAGE, &type, &int_value, &ft, buffer, &sz);
-todo_wine
ok(hinst, !r, "got %u\n", r);
-todo_wine
ok(hinst, type == 0, "got %u\n", type);
-todo_wine
ok(hinst, int_value == 0, "got %u\n", int_value);
ok(hinst, sz == sizeof(buffer), "got %u\n", sz);
ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer);
diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl
index 5a14ffdb79..ebbca82a16 100644
--- a/dlls/msi/winemsi.idl
+++ b/dlls/msi/winemsi.idl
@@ -75,6 +75,8 @@ interface IWineMsiRemote
UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view );
UINT remote_SummaryInfoGetPropertyCount( [in] MSIHANDLE suminfo, [out] UINT *count );
+ UINT remote_SummaryInfoGetProperty( [in] MSIHANDLE suminfo, [in] UINT property, [out] UINT *type, [out] INT *value,
+ [out] FILETIME *ft, [out, string] LPWSTR *buf );
MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst );
UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size );
--
2.17.1
4
4
[PATCH v2] jsproxy: Fix parameters validation in InternetInitializeAutoProxyDll.
by Piotr Caban 29 Aug '18
by Piotr Caban 29 Aug '18
29 Aug '18
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
v2:
- fix test failures
dlls/jsproxy/main.c | 11 +++--------
dlls/jsproxy/tests/jsproxy.c | 17 +++++++++++++++++
2 files changed, 20 insertions(+), 8 deletions(-)
1
0
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
dlls/dxgi/device.c | 14 +++++++-------
dlls/dxgi/surface.c | 20 ++++++++++----------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c
index 5607c380f1ff..67cadd5a3f89 100644
--- a/dlls/dxgi/device.c
+++ b/dlls/dxgi/device.c
@@ -33,7 +33,7 @@ static inline struct dxgi_device *impl_from_IWineDXGIDevice(IWineDXGIDevice *ifa
static HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IWineDXGIDevice *iface, REFIID riid, void **object)
{
- struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
+ struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
@@ -49,10 +49,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IWineDXGIDevice *ifa
return S_OK;
}
- if (This->child_layer)
+ if (device->child_layer)
{
- TRACE("forwarding to child layer %p.\n", This->child_layer);
- return IUnknown_QueryInterface(This->child_layer, riid, object);
+ TRACE("Forwarding to child layer %p.\n", device->child_layer);
+ return IUnknown_QueryInterface(device->child_layer, riid, object);
}
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
@@ -63,10 +63,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IWineDXGIDevice *ifa
static ULONG STDMETHODCALLTYPE dxgi_device_AddRef(IWineDXGIDevice *iface)
{
- struct dxgi_device *This = impl_from_IWineDXGIDevice(iface);
- ULONG refcount = InterlockedIncrement(&This->refcount);
+ struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
+ ULONG refcount = InterlockedIncrement(&device->refcount);
- TRACE("%p increasing refcount to %u\n", This, refcount);
+ TRACE("%p increasing refcount to %u\n", device, refcount);
return refcount;
}
diff --git a/dlls/dxgi/surface.c b/dlls/dxgi/surface.c
index ad72a2c73613..1f53b25a9124 100644
--- a/dlls/dxgi/surface.c
+++ b/dlls/dxgi/surface.c
@@ -90,23 +90,23 @@ static inline struct dxgi_surface *impl_from_IDXGISurface1(IDXGISurface1 *iface)
static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface1 *iface, REFIID riid,
void **object)
{
- struct dxgi_surface *This = impl_from_IDXGISurface1(iface);
+ struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("Forwarding to outer IUnknown\n");
- return IUnknown_QueryInterface(This->outer_unknown, riid, object);
+ return IUnknown_QueryInterface(surface->outer_unknown, riid, object);
}
static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface1 *iface)
{
- struct dxgi_surface *This = impl_from_IDXGISurface1(iface);
+ struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("Forwarding to outer IUnknown\n");
- return IUnknown_AddRef(This->outer_unknown);
+ return IUnknown_AddRef(surface->outer_unknown);
}
static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface1 *iface)
{
- struct dxgi_surface *This = impl_from_IDXGISurface1(iface);
+ struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("Forwarding to outer IUnknown\n");
- return IUnknown_Release(This->outer_unknown);
+ return IUnknown_Release(surface->outer_unknown);
}
/* IDXGIObject methods */
@@ -143,22 +143,22 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface1 *ifac
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface1 *iface, REFIID riid, void **parent)
{
- struct dxgi_surface *This = impl_from_IDXGISurface1(iface);
+ struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
- return IDXGIDevice_QueryInterface(This->device, riid, parent);
+ return IDXGIDevice_QueryInterface(surface->device, riid, parent);
}
/* IDXGIDeviceSubObject methods */
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface1 *iface, REFIID riid, void **device)
{
- struct dxgi_surface *This = impl_from_IDXGISurface1(iface);
+ struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
- return IDXGIDevice_QueryInterface(This->device, riid, device);
+ return IDXGIDevice_QueryInterface(surface->device, riid, device);
}
/* IDXGISurface methods */
--
2.16.4
2
1
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
dlls/dxgi/tests/dxgi.c | 266 +++++++++++++++++++++++++++++--------------------
1 file changed, 159 insertions(+), 107 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c
index 56065456eb0d..376c1ecd6fdf 100644
--- a/dlls/dxgi/tests/dxgi.c
+++ b/dlls/dxgi/tests/dxgi.c
@@ -3026,38 +3026,105 @@ static void test_private_data(void)
ok(!refcount, "Test object has %u references left.\n", refcount);
}
-static void test_swapchain_resize(void)
+#define check_surface_desc(a, b) check_surface_desc_(__LINE__, a, b)
+static void check_surface_desc_(unsigned int line, IDXGISurface *surface,
+ const DXGI_SWAP_CHAIN_DESC *swapchain_desc)
+{
+ DXGI_SURFACE_DESC surface_desc;
+ HRESULT hr;
+
+ hr = IDXGISurface_GetDesc(surface, &surface_desc);
+ ok_(__FILE__, line)(hr == S_OK, "Failed to get surface desc, hr %#x.\n", hr);
+ ok_(__FILE__, line)(surface_desc.Width == swapchain_desc->BufferDesc.Width,
+ "Got Width %u, expected %u.\n", surface_desc.Width, swapchain_desc->BufferDesc.Width);
+ ok_(__FILE__, line)(surface_desc.Height == swapchain_desc->BufferDesc.Height,
+ "Got Height %u, expected %u.\n", surface_desc.Height, swapchain_desc->BufferDesc.Height);
+ ok_(__FILE__, line)(surface_desc.Format == swapchain_desc->BufferDesc.Format,
+ "Got Format %#x, expected %#x.\n", surface_desc.Format, swapchain_desc->BufferDesc.Format);
+ ok_(__FILE__, line)(surface_desc.SampleDesc.Count == 1,
+ "Got unexpected SampleDesc.Count %u.\n", surface_desc.SampleDesc.Count);
+ ok_(__FILE__, line)(!surface_desc.SampleDesc.Quality,
+ "Got unexpected SampleDesc.Quality %u.\n", surface_desc.SampleDesc.Quality);
+}
+
+#define check_texture_desc(a, b) check_texture_desc_(__LINE__, a, b)
+static void check_texture_desc_(unsigned int line, ID3D10Texture2D *texture,
+ const DXGI_SWAP_CHAIN_DESC *swapchain_desc)
{
- DXGI_SWAP_CHAIN_DESC swapchain_desc;
D3D10_TEXTURE2D_DESC texture_desc;
- DXGI_SURFACE_DESC surface_desc;
+
+ ID3D10Texture2D_GetDesc(texture, &texture_desc);
+ ok_(__FILE__, line)(texture_desc.Width == swapchain_desc->BufferDesc.Width,
+ "Got Width %u, expected %u.\n", texture_desc.Width, swapchain_desc->BufferDesc.Width);
+ ok_(__FILE__, line)(texture_desc.Height == swapchain_desc->BufferDesc.Height,
+ "Got Height %u, expected %u.\n", texture_desc.Height, swapchain_desc->BufferDesc.Height);
+ ok_(__FILE__, line)(texture_desc.MipLevels == 1, "Got unexpected MipLevels %u.\n", texture_desc.MipLevels);
+ ok_(__FILE__, line)(texture_desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", texture_desc.ArraySize);
+ ok_(__FILE__, line)(texture_desc.Format == swapchain_desc->BufferDesc.Format,
+ "Got Format %#x, expected %#x.\n", texture_desc.Format, swapchain_desc->BufferDesc.Format);
+ ok_(__FILE__, line)(texture_desc.SampleDesc.Count == 1,
+ "Got unexpected SampleDesc.Count %u.\n", texture_desc.SampleDesc.Count);
+ ok_(__FILE__, line)(!texture_desc.SampleDesc.Quality,
+ "Got unexpected SampleDesc.Quality %u.\n", texture_desc.SampleDesc.Quality);
+ ok_(__FILE__, line)(texture_desc.Usage == D3D10_USAGE_DEFAULT,
+ "Got unexpected Usage %#x.\n", texture_desc.Usage);
+ ok_(__FILE__, line)(texture_desc.BindFlags == D3D10_BIND_RENDER_TARGET,
+ "Got unexpected BindFlags %#x.\n", texture_desc.BindFlags);
+ ok_(__FILE__, line)(!texture_desc.CPUAccessFlags,
+ "Got unexpected CPUAccessFlags %#x.\n", texture_desc.CPUAccessFlags);
+ ok_(__FILE__, line)(!texture_desc.MiscFlags, "Got unexpected MiscFlags %#x.\n", texture_desc.MiscFlags);
+}
+
+#define check_resource_desc(a, b) check_resource_desc_(__LINE__, a, b)
+static void check_resource_desc_(unsigned int line, ID3D12Resource *resource,
+ const DXGI_SWAP_CHAIN_DESC *swapchain_desc)
+{
+ D3D12_RESOURCE_DESC resource_desc;
+
+ resource_desc = ID3D12Resource_GetDesc(resource);
+ ok_(__FILE__, line)(resource_desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D,
+ "Got unexpected Dimension %#x.\n", resource_desc.Dimension);
+ ok_(__FILE__, line)(resource_desc.Width == swapchain_desc->BufferDesc.Width, "Got Width %s, expected %u.\n",
+ wine_dbgstr_longlong(resource_desc.Width), swapchain_desc->BufferDesc.Width);
+ ok_(__FILE__, line)(resource_desc.Height == swapchain_desc->BufferDesc.Height,
+ "Got Height %u, expected %u.\n", resource_desc.Height, swapchain_desc->BufferDesc.Height);
+ ok_(__FILE__, line)(resource_desc.DepthOrArraySize == 1,
+ "Got unexpected DepthOrArraySize %u.\n", resource_desc.DepthOrArraySize);
+ ok_(__FILE__, line)(resource_desc.MipLevels == 1,
+ "Got unexpected MipLevels %u.\n", resource_desc.MipLevels);
+ ok_(__FILE__, line)(resource_desc.Format == swapchain_desc->BufferDesc.Format,
+ "Got Format %#x, expected %#x.\n", resource_desc.Format, swapchain_desc->BufferDesc.Format);
+ ok_(__FILE__, line)(resource_desc.SampleDesc.Count == 1,
+ "Got unexpected SampleDesc.Count %u.\n", resource_desc.SampleDesc.Count);
+ ok_(__FILE__, line)(!resource_desc.SampleDesc.Quality,
+ "Got unexpected SampleDesc.Quality %u.\n", resource_desc.SampleDesc.Quality);
+ ok_(__FILE__, line)(resource_desc.Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN,
+ "Got unexpected Layout %#x.\n", resource_desc.Layout);
+}
+
+static void test_swapchain_resize(IUnknown *device, BOOL is_d3d12)
+{
+ DXGI_SWAP_CHAIN_DESC swapchain_desc;
+ DXGI_SWAP_EFFECT swap_effect;
IDXGISwapChain *swapchain;
+ ID3D12Resource *resource;
ID3D10Texture2D *texture;
+ HRESULT hr, expected_hr;
IDXGISurface *surface;
- IDXGIAdapter *adapter;
IDXGIFactory *factory;
- IDXGIDevice *device;
RECT client_rect, r;
ULONG refcount;
HWND window;
- HRESULT hr;
BOOL ret;
- if (!(device = create_device(0)))
- {
- skip("Failed to create device, skipping tests.\n");
- return;
- }
+ get_factory(device, is_d3d12, &factory);
+
window = CreateWindowA("static", "dxgi_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
ret = GetClientRect(window, &client_rect);
ok(ret, "Failed to get client rect.\n");
- hr = IDXGIDevice_GetAdapter(device, &adapter);
- ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr);
- hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory);
- ok(SUCCEEDED(hr), "Failed to get factory, hr %#x.\n", hr);
- IDXGIAdapter_Release(adapter);
+ swap_effect = is_d3d12 ? DXGI_SWAP_EFFECT_FLIP_DISCARD : DXGI_SWAP_EFFECT_DISCARD;
swapchain_desc.BufferDesc.Width = 640;
swapchain_desc.BufferDesc.Height = 480;
@@ -3069,19 +3136,25 @@ static void test_swapchain_resize(void)
swapchain_desc.SampleDesc.Count = 1;
swapchain_desc.SampleDesc.Quality = 0;
swapchain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- swapchain_desc.BufferCount = 1;
+ swapchain_desc.BufferCount = 2;
swapchain_desc.OutputWindow = window;
swapchain_desc.Windowed = TRUE;
- swapchain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
+ swapchain_desc.SwapEffect = swap_effect;
swapchain_desc.Flags = 0;
- hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain);
- ok(SUCCEEDED(hr), "Failed to create swapchain, hr %#x.\n", hr);
- IDXGIFactory_Release(factory);
+ hr = IDXGIFactory_CreateSwapChain(factory, device, &swapchain_desc, &swapchain);
+ ok(hr == S_OK, "Failed to create swapchain, hr %#x.\n", hr);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+ expected_hr = is_d3d12 ? E_NOINTERFACE : S_OK;
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!surface || hr == S_OK, "Got unexpected pointer %p.\n", surface);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D10Texture2D, (void **)&texture);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!texture || hr == S_OK, "Got unexpected pointer %p.\n", texture);
+ expected_hr = is_d3d12 ? S_OK : E_NOINTERFACE;
+ hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D12Resource, (void **)&resource);
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!resource || hr == S_OK, "Got unexpected pointer %p.\n", resource);
ret = GetClientRect(window, &r);
ok(ret, "Failed to get client rect.\n");
@@ -3113,39 +3186,25 @@ static void test_swapchain_resize(void)
"Got unexpected SampleDesc.Quality %u.\n", swapchain_desc.SampleDesc.Quality);
ok(swapchain_desc.BufferUsage == DXGI_USAGE_RENDER_TARGET_OUTPUT,
"Got unexpected BufferUsage %#x.\n", swapchain_desc.BufferUsage);
- ok(swapchain_desc.BufferCount == 1,
+ ok(swapchain_desc.BufferCount == 2,
"Got unexpected BufferCount %u.\n", swapchain_desc.BufferCount);
ok(swapchain_desc.OutputWindow == window,
"Got unexpected OutputWindow %p, expected %p.\n", swapchain_desc.OutputWindow, window);
ok(swapchain_desc.Windowed,
"Got unexpected Windowed %#x.\n", swapchain_desc.Windowed);
- ok(swapchain_desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD,
+ ok(swapchain_desc.SwapEffect == swap_effect,
"Got unexpected SwapEffect %#x.\n", swapchain_desc.SwapEffect);
ok(!swapchain_desc.Flags,
"Got unexpected Flags %#x.\n", swapchain_desc.Flags);
- hr = IDXGISurface_GetDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
- ok(surface_desc.Width == 640, "Got unexpected Width %u.\n", surface_desc.Width);
- ok(surface_desc.Height == 480, "Got unexpected Height %u.\n", surface_desc.Height);
- ok(surface_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", surface_desc.Format);
- ok(surface_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", surface_desc.SampleDesc.Count);
- ok(!surface_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", surface_desc.SampleDesc.Quality);
+ if (surface)
+ check_surface_desc(surface, &swapchain_desc);
+ if (texture)
+ check_texture_desc(texture, &swapchain_desc);
+ if (resource)
+ check_resource_desc(resource, &swapchain_desc);
- ID3D10Texture2D_GetDesc(texture, &texture_desc);
- ok(texture_desc.Width == 640, "Got unexpected Width %u.\n", texture_desc.Width);
- ok(texture_desc.Height == 480, "Got unexpected Height %u.\n", texture_desc.Height);
- ok(texture_desc.MipLevels == 1, "Got unexpected MipLevels %u.\n", texture_desc.MipLevels);
- ok(texture_desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", texture_desc.ArraySize);
- ok(texture_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", texture_desc.Format);
- ok(texture_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", texture_desc.SampleDesc.Count);
- ok(!texture_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", texture_desc.SampleDesc.Quality);
- ok(texture_desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected Usage %#x.\n", texture_desc.Usage);
- ok(texture_desc.BindFlags == D3D10_BIND_RENDER_TARGET, "Got unexpected BindFlags %#x.\n", texture_desc.BindFlags);
- ok(!texture_desc.CPUAccessFlags, "Got unexpected CPUAccessFlags %#x.\n", texture_desc.CPUAccessFlags);
- ok(!texture_desc.MiscFlags, "Got unexpected MiscFlags %#x.\n", texture_desc.MiscFlags);
-
- hr = IDXGISwapChain_ResizeBuffers(swapchain, 1, 320, 240, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, 0);
+ hr = IDXGISwapChain_ResizeBuffers(swapchain, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0);
ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
ret = GetClientRect(window, &r);
@@ -3178,46 +3237,46 @@ static void test_swapchain_resize(void)
"Got unexpected SampleDesc.Quality %u.\n", swapchain_desc.SampleDesc.Quality);
ok(swapchain_desc.BufferUsage == DXGI_USAGE_RENDER_TARGET_OUTPUT,
"Got unexpected BufferUsage %#x.\n", swapchain_desc.BufferUsage);
- ok(swapchain_desc.BufferCount == 1,
+ ok(swapchain_desc.BufferCount == 2,
"Got unexpected BufferCount %u.\n", swapchain_desc.BufferCount);
ok(swapchain_desc.OutputWindow == window,
"Got unexpected OutputWindow %p, expected %p.\n", swapchain_desc.OutputWindow, window);
ok(swapchain_desc.Windowed,
"Got unexpected Windowed %#x.\n", swapchain_desc.Windowed);
- ok(swapchain_desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD,
+ ok(swapchain_desc.SwapEffect == swap_effect,
"Got unexpected SwapEffect %#x.\n", swapchain_desc.SwapEffect);
ok(!swapchain_desc.Flags,
"Got unexpected Flags %#x.\n", swapchain_desc.Flags);
- hr = IDXGISurface_GetDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
- ok(surface_desc.Width == 640, "Got unexpected Width %u.\n", surface_desc.Width);
- ok(surface_desc.Height == 480, "Got unexpected Height %u.\n", surface_desc.Height);
- ok(surface_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", surface_desc.Format);
- ok(surface_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", surface_desc.SampleDesc.Count);
- ok(!surface_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", surface_desc.SampleDesc.Quality);
+ if (surface)
+ {
+ check_surface_desc(surface, &swapchain_desc);
+ IDXGISurface_Release(surface);
+ }
+ if (texture)
+ {
+ check_texture_desc(texture, &swapchain_desc);
+ ID3D10Texture2D_Release(texture);
+ }
+ if (resource)
+ {
+ check_resource_desc(resource, &swapchain_desc);
+ ID3D12Resource_Release(resource);
+ }
- ID3D10Texture2D_GetDesc(texture, &texture_desc);
- ok(texture_desc.Width == 640, "Got unexpected Width %u.\n", texture_desc.Width);
- ok(texture_desc.Height == 480, "Got unexpected Height %u.\n", texture_desc.Height);
- ok(texture_desc.MipLevels == 1, "Got unexpected MipLevels %u.\n", texture_desc.MipLevels);
- ok(texture_desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", texture_desc.ArraySize);
- ok(texture_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", texture_desc.Format);
- ok(texture_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", texture_desc.SampleDesc.Count);
- ok(!texture_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", texture_desc.SampleDesc.Quality);
- ok(texture_desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected Usage %#x.\n", texture_desc.Usage);
- ok(texture_desc.BindFlags == D3D10_BIND_RENDER_TARGET, "Got unexpected BindFlags %#x.\n", texture_desc.BindFlags);
- ok(!texture_desc.CPUAccessFlags, "Got unexpected CPUAccessFlags %#x.\n", texture_desc.CPUAccessFlags);
- ok(!texture_desc.MiscFlags, "Got unexpected MiscFlags %#x.\n", texture_desc.MiscFlags);
-
- ID3D10Texture2D_Release(texture);
- IDXGISurface_Release(surface);
- hr = IDXGISwapChain_ResizeBuffers(swapchain, 1, 320, 240, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, 0);
- ok(SUCCEEDED(hr), "Failed to resize buffers, hr %#x.\n", hr);
+ hr = IDXGISwapChain_ResizeBuffers(swapchain, 2, 320, 240, DXGI_FORMAT_B8G8R8A8_UNORM, 0);
+ ok(hr == S_OK, "Failed to resize buffers, hr %#x.\n", hr);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+ expected_hr = is_d3d12 ? E_NOINTERFACE : S_OK;
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!surface || hr == S_OK, "Got unexpected pointer %p.\n", surface);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D10Texture2D, (void **)&texture);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!texture || hr == S_OK, "Got unexpected pointer %p.\n", texture);
+ expected_hr = is_d3d12 ? S_OK : E_NOINTERFACE;
+ hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D12Resource, (void **)&resource);
+ ok(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok(!resource || hr == S_OK, "Got unexpected pointer %p.\n", resource);
ret = GetClientRect(window, &r);
ok(ret, "Failed to get client rect.\n");
@@ -3237,7 +3296,7 @@ static void test_swapchain_resize(void)
ok(swapchain_desc.BufferDesc.RefreshRate.Denominator == 1,
"Got unexpected BufferDesc.RefreshRate.Denominator %u.\n",
swapchain_desc.BufferDesc.RefreshRate.Denominator);
- ok(swapchain_desc.BufferDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
+ ok(swapchain_desc.BufferDesc.Format == DXGI_FORMAT_B8G8R8A8_UNORM,
"Got unexpected BufferDesc.Format %#x.\n", swapchain_desc.BufferDesc.Format);
ok(swapchain_desc.BufferDesc.ScanlineOrdering == DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED,
"Got unexpected BufferDesc.ScanlineOrdering %#x.\n", swapchain_desc.BufferDesc.ScanlineOrdering);
@@ -3249,43 +3308,35 @@ static void test_swapchain_resize(void)
"Got unexpected SampleDesc.Quality %u.\n", swapchain_desc.SampleDesc.Quality);
ok(swapchain_desc.BufferUsage == DXGI_USAGE_RENDER_TARGET_OUTPUT,
"Got unexpected BufferUsage %#x.\n", swapchain_desc.BufferUsage);
- ok(swapchain_desc.BufferCount == 1,
+ ok(swapchain_desc.BufferCount == 2,
"Got unexpected BufferCount %u.\n", swapchain_desc.BufferCount);
ok(swapchain_desc.OutputWindow == window,
"Got unexpected OutputWindow %p, expected %p.\n", swapchain_desc.OutputWindow, window);
ok(swapchain_desc.Windowed,
"Got unexpected Windowed %#x.\n", swapchain_desc.Windowed);
- ok(swapchain_desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD,
+ ok(swapchain_desc.SwapEffect == swap_effect,
"Got unexpected SwapEffect %#x.\n", swapchain_desc.SwapEffect);
ok(!swapchain_desc.Flags,
"Got unexpected Flags %#x.\n", swapchain_desc.Flags);
- hr = IDXGISurface_GetDesc(surface, &surface_desc);
- ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
- ok(surface_desc.Width == 320, "Got unexpected Width %u.\n", surface_desc.Width);
- ok(surface_desc.Height == 240, "Got unexpected Height %u.\n", surface_desc.Height);
- ok(surface_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, "Got unexpected Format %#x.\n", surface_desc.Format);
- ok(surface_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", surface_desc.SampleDesc.Count);
- ok(!surface_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", surface_desc.SampleDesc.Quality);
-
- ID3D10Texture2D_GetDesc(texture, &texture_desc);
- ok(texture_desc.Width == 320, "Got unexpected Width %u.\n", texture_desc.Width);
- ok(texture_desc.Height == 240, "Got unexpected Height %u.\n", texture_desc.Height);
- ok(texture_desc.MipLevels == 1, "Got unexpected MipLevels %u.\n", texture_desc.MipLevels);
- ok(texture_desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", texture_desc.ArraySize);
- ok(texture_desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, "Got unexpected Format %#x.\n", texture_desc.Format);
- ok(texture_desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", texture_desc.SampleDesc.Count);
- ok(!texture_desc.SampleDesc.Quality, "Got unexpected SampleDesc.Quality %u.\n", texture_desc.SampleDesc.Quality);
- ok(texture_desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected Usage %#x.\n", texture_desc.Usage);
- ok(texture_desc.BindFlags == D3D10_BIND_RENDER_TARGET, "Got unexpected BindFlags %#x.\n", texture_desc.BindFlags);
- ok(!texture_desc.CPUAccessFlags, "Got unexpected CPUAccessFlags %#x.\n", texture_desc.CPUAccessFlags);
- ok(!texture_desc.MiscFlags, "Got unexpected MiscFlags %#x.\n", texture_desc.MiscFlags);
-
- ID3D10Texture2D_Release(texture);
- IDXGISurface_Release(surface);
+ if (surface)
+ {
+ check_surface_desc(surface, &swapchain_desc);
+ IDXGISurface_Release(surface);
+ }
+ if (texture)
+ {
+ check_texture_desc(texture, &swapchain_desc);
+ ID3D10Texture2D_Release(texture);
+ }
+ if (resource)
+ {
+ check_resource_desc(resource, &swapchain_desc);
+ ID3D12Resource_Release(resource);
+ }
hr = IDXGISwapChain_ResizeBuffers(swapchain, 0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);
- ok(SUCCEEDED(hr), "Failed to resize buffers, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to resize buffers, hr %#x.\n", hr);
memset(&swapchain_desc, 0, sizeof(swapchain_desc));
hr = IDXGISwapChain_GetDesc(swapchain, &swapchain_desc);
@@ -3302,7 +3353,7 @@ static void test_swapchain_resize(void)
ok(swapchain_desc.BufferDesc.RefreshRate.Denominator == 1,
"Got unexpected BufferDesc.RefreshRate.Denominator %u.\n",
swapchain_desc.BufferDesc.RefreshRate.Denominator);
- ok(swapchain_desc.BufferDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
+ ok(swapchain_desc.BufferDesc.Format == DXGI_FORMAT_B8G8R8A8_UNORM,
"Got unexpected BufferDesc.Format %#x.\n", swapchain_desc.BufferDesc.Format);
ok(swapchain_desc.BufferDesc.ScanlineOrdering == DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED,
"Got unexpected BufferDesc.ScanlineOrdering %#x.\n", swapchain_desc.BufferDesc.ScanlineOrdering);
@@ -3314,21 +3365,21 @@ static void test_swapchain_resize(void)
"Got unexpected SampleDesc.Quality %u.\n", swapchain_desc.SampleDesc.Quality);
ok(swapchain_desc.BufferUsage == DXGI_USAGE_RENDER_TARGET_OUTPUT,
"Got unexpected BufferUsage %#x.\n", swapchain_desc.BufferUsage);
- ok(swapchain_desc.BufferCount == 1,
+ ok(swapchain_desc.BufferCount == 2,
"Got unexpected BufferCount %u.\n", swapchain_desc.BufferCount);
ok(swapchain_desc.OutputWindow == window,
"Got unexpected OutputWindow %p, expected %p.\n", swapchain_desc.OutputWindow, window);
ok(swapchain_desc.Windowed,
"Got unexpected Windowed %#x.\n", swapchain_desc.Windowed);
- ok(swapchain_desc.SwapEffect == DXGI_SWAP_EFFECT_DISCARD,
+ ok(swapchain_desc.SwapEffect == swap_effect,
"Got unexpected SwapEffect %#x.\n", swapchain_desc.SwapEffect);
ok(!swapchain_desc.Flags,
"Got unexpected Flags %#x.\n", swapchain_desc.Flags);
IDXGISwapChain_Release(swapchain);
- refcount = IDXGIDevice_Release(device);
- ok(!refcount, "Device has %u references left.\n", refcount);
DestroyWindow(window);
+ refcount = IDXGIFactory_Release(factory);
+ ok(refcount == !is_d3d12, "Got unexpected refcount %u.\n", refcount);
}
static void test_swapchain_parameters(void)
@@ -4143,7 +4194,6 @@ START_TEST(dxgi)
queue_test(test_get_containing_output);
queue_test(test_create_factory);
queue_test(test_private_data);
- queue_test(test_swapchain_resize);
queue_test(test_swapchain_present);
queue_test(test_maximum_frame_latency);
queue_test(test_output_desc);
@@ -4158,6 +4208,7 @@ START_TEST(dxgi)
test_resize_target();
test_inexact_modes();
test_swapchain_parameters();
+ run_on_d3d10(test_swapchain_resize);
run_on_d3d10(test_swapchain_backbuffer_index);
if (!(d3d12_module = LoadLibraryA("d3d12.dll")))
@@ -4175,6 +4226,7 @@ START_TEST(dxgi)
ID3D12Debug_Release(debug);
}
+ run_on_d3d12(test_swapchain_resize);
run_on_d3d12(test_swapchain_backbuffer_index);
FreeLibrary(d3d12_module);
--
2.16.4
2
1