Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
January 2022
- 86 participants
- 2418 messages
Re: [PATCH v4 1/4] wdscore: Implement CurrentIP.
by Mohamad Al-Jaf
Hi,
> Every process has its own virtual address space (VAS) [1].
Thanks for the detailed explanation and also for the references. I didn't
know about Windows Internals, seems like a good book to learn about how
Windows works, much appreciated.
> Since it has no arguments and is not a "public" exported function it
> probably does not matter. But yes, using __ASM_STDCALL_FUNC without
> declaring it as WINAPI is a mismatch. You should be using either
> __ASM_GLOBAL_FUNC and no WINAPI, or __ASM_STDCALL_FUNC with WINAPI.
>
> I guess if the header doesn't use WINAPI, might as well make it without.
Yeah, I don't think it really matters. But I just want it to be as accurate
as possible to the Windows implementation. Thank you for the clarification,
I wasn't sure what to do.
> I mostly agree and tried here to interpret Dmitry's statement.
I see, yeah, I also agree that it's not necessary.
I've submitted a revision.
Jan. 31, 2022
[PATCH v6 4/4] wdscore: Add stubs for WdsSetupLogMessage[AW].
by Mohamad Al-Jaf
Required by the Windows MediaCreationTool21H2.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
v4: - Add missing argument.
- Rename one more unknown.
v6: - Rebase.
---
dlls/wdscore/main.c | 28 ++++++++++++++++++++++++++++
dlls/wdscore/wdscore.spec | 4 ++--
dlls/wdscore/wdscore_internal.h | 27 +++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/dlls/wdscore/main.c b/dlls/wdscore/main.c
index bda3b4ce6fa..15e285f6ca8 100644
--- a/dlls/wdscore/main.c
+++ b/dlls/wdscore/main.c
@@ -74,3 +74,31 @@ LPVOID WINAPI ConstructPartialMsgVW( WdsLogLevel level, LPCWSTR msg, va_list arg
FIXME( "%u %s - stub\n", level, debugstr_w(msg) );
return NULL;
}
+
+
+/***********************************************************************
+ * WdsSetupLogMessageA (wdscore.@)
+ */
+HRESULT WINAPI WdsSetupLogMessageA( LPVOID msg, WdsLogSource src, LPCSTR unknown1, LPCSTR unknown2,
+ ULONG unknown3, LPCSTR file, LPCSTR func, void *ip,
+ ULONG unknown4, void *unknown5, UINT unknown6 )
+{
+ FIXME( "%p, %u, %s, %s, %u, %s, %s, %p, %u, %p, %u - stub\n", msg, src, debugstr_a(unknown1),
+ debugstr_a(unknown2), unknown3, debugstr_a(file), debugstr_a(func), ip, unknown4,
+ unknown5, unknown6 );
+ return S_OK;
+}
+
+
+/***********************************************************************
+ * WdsSetupLogMessageW (wdscore.@)
+ */
+HRESULT WINAPI WdsSetupLogMessageW( LPVOID msg, WdsLogSource src, LPCWSTR unknown1, LPCWSTR unknown2,
+ ULONG unknown3, LPCWSTR file, LPCWSTR func, void *ip,
+ ULONG unknown4, void *unknown5, UINT unknown6 )
+{
+ FIXME( "%p, %u, %s, %s, %u, %s, %s, %p, %u, %p, %u - stub\n", msg, src, debugstr_w(unknown1),
+ debugstr_w(unknown2), unknown3, debugstr_w(file), debugstr_w(func), ip, unknown4,
+ unknown5, unknown6 );
+ return S_OK;
+}
diff --git a/dlls/wdscore/wdscore.spec b/dlls/wdscore/wdscore.spec
index fa4c318ddaa..c81c55e31d5 100644
--- a/dlls/wdscore/wdscore.spec
+++ b/dlls/wdscore/wdscore.spec
@@ -150,8 +150,8 @@
@ stub WdsSetUILanguage
@ stub WdsSetupLogDestroy
@ stub WdsSetupLogInit
-@ stub WdsSetupLogMessageA
-@ stub WdsSetupLogMessageW
+@ stdcall WdsSetupLogMessageA(ptr long str str long str str ptr long ptr long)
+@ stdcall WdsSetupLogMessageW(ptr long wstr wstr long wstr wstr ptr long ptr long)
@ stub WdsSubscribeEx
@ stub WdsTerminate
@ stub WdsUnlockExecutionGroup
diff --git a/dlls/wdscore/wdscore_internal.h b/dlls/wdscore/wdscore_internal.h
index 507aa8f6068..d9048d501fc 100644
--- a/dlls/wdscore/wdscore_internal.h
+++ b/dlls/wdscore/wdscore_internal.h
@@ -30,6 +30,33 @@ typedef enum _WdsLogLevel {
WdsLogLevelTrace = 0x7000000
} WdsLogLevel;
+typedef enum _WdsLogSource {
+ WdsLogSourceDPX = 0x1000000,
+ WdsLogSourceCBS = 0x2000000,
+ WdsLogSourceCSI = 0x1800000,
+ WdsLogSourceSXS = 0x2800000,
+ WdsLogSourceCMI = 0x3000000,
+ WdsLogSourceDEPLOY = 0x4000000,
+ WdsLogSourceDU = 0x5000000,
+ WdsLogSourceIBS = 0x6000000,
+ WdsLogSourceIBSLIB = 0x6400000,
+ WdsLogSourceDIAG = 0x7000000,
+ WdsLogSourceDIAGER = 0x7400000,
+ WdsLogSourceMIG = 0x8000000,
+ WdsLogSourceHWARE = 0x8400000,
+ WdsLogSourceMIGUI = 0x8800000,
+ WdsLogSourceUI = 0xA000000,
+ WdsLogSourceCONX = 0xA400000,
+ WdsLogSourceMOUPG = 0xA800000,
+ WdsLogSourceWDS = 0xB000000,
+ WdsLogSourceDISM = 0xB800000,
+ WdsLogSourcePANTHR = 0x9000000,
+ WdsLogSourceWINPE = 0xC000000,
+ WdsLogSourceSP = 0xC800000,
+ WdsLogSourceLIB = 0xD000000,
+ WdsLogSourceTOOL = 0xE000000
+} WdsLogSource;
+
void *CurrentIP(void);
#endif /* __WDSCORE_INTERNAL_H */
--
2.35.0
Jan. 31, 2022
[PATCH v6 3/4] wdscore: Add stubs for ConstructPartialMsgV[AW].
by Mohamad Al-Jaf
Enables the Windows MediaCreationTool21H2 to run.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
v6: - Rebase.
---
dlls/wdscore/main.c | 20 ++++++++++++++++++++
dlls/wdscore/wdscore.spec | 4 ++--
dlls/wdscore/wdscore_internal.h | 11 +++++++++++
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/wdscore/main.c b/dlls/wdscore/main.c
index 1ed00206adf..bda3b4ce6fa 100644
--- a/dlls/wdscore/main.c
+++ b/dlls/wdscore/main.c
@@ -54,3 +54,23 @@ void *CurrentIP(void)
return 0;
}
#endif
+
+
+/***********************************************************************
+ * ConstructPartialMsgVA (wdscore.@)
+ */
+LPVOID WINAPI ConstructPartialMsgVA( WdsLogLevel level, LPCSTR msg, va_list args )
+{
+ FIXME( "%u %s - stub\n", level, debugstr_a(msg) );
+ return NULL;
+}
+
+
+/***********************************************************************
+ * ConstructPartialMsgVW (wdscore.@)
+ */
+LPVOID WINAPI ConstructPartialMsgVW( WdsLogLevel level, LPCWSTR msg, va_list args )
+{
+ FIXME( "%u %s - stub\n", level, debugstr_w(msg) );
+ return NULL;
+}
diff --git a/dlls/wdscore/wdscore.spec b/dlls/wdscore/wdscore.spec
index f90268eb3be..fa4c318ddaa 100644
--- a/dlls/wdscore/wdscore.spec
+++ b/dlls/wdscore/wdscore.spec
@@ -69,8 +69,8 @@
#@ extern g_bEnableDiagnosticMode
@ stub ConstructPartialMsgIfA
@ stub ConstructPartialMsgIfW
-@ stub ConstructPartialMsgVA
-@ stub ConstructPartialMsgVW
+@ stdcall ConstructPartialMsgVA(long str ptr)
+@ stdcall ConstructPartialMsgVW(long wstr ptr)
@ cdecl CurrentIP()
@ stub EndMajorTask
@ stub EndMinorTask
diff --git a/dlls/wdscore/wdscore_internal.h b/dlls/wdscore/wdscore_internal.h
index 595ce93a3e7..507aa8f6068 100644
--- a/dlls/wdscore/wdscore_internal.h
+++ b/dlls/wdscore/wdscore_internal.h
@@ -19,6 +19,17 @@
#ifndef __WDSCORE_INTERNAL_H
#define __WDSCORE_INTERNAL_H
+typedef enum _WdsLogLevel {
+ WdsLogLevelAssert = 0x0000000,
+ WdsLogLevelFatalError = 0x1000000,
+ WdsLogLevelError = 0x2000000,
+ WdsLogLevelWarning = 0x3000000,
+ WdsLogLevelInfo = 0x4000000,
+ WdsLogLevelStatus = 0x5000000,
+ WdsLogLevelVerbose = 0x6800000,
+ WdsLogLevelTrace = 0x7000000
+} WdsLogLevel;
+
void *CurrentIP(void);
#endif /* __WDSCORE_INTERNAL_H */
--
2.35.0
Jan. 31, 2022
[PATCH v6 2/4] wdscore: Fix spec entries.
by Mohamad Al-Jaf
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
dlls/wdscore/wdscore.spec | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wdscore/wdscore.spec b/dlls/wdscore/wdscore.spec
index c292f65505b..f90268eb3be 100644
--- a/dlls/wdscore/wdscore.spec
+++ b/dlls/wdscore/wdscore.spec
@@ -116,7 +116,7 @@
@ stub WdsGetBlackboardValue
@ stub WdsGetCurrentExecutionGroup
@ stub WdsGetSetupLog
-@ stub WdsTempDir
+@ stub WdsGetTempDir
@ stub WdsInitialize
@ stub WdsInitializeCallbackArray
@ stub WdsInitializeDataBinary
@@ -139,7 +139,7 @@
@ stub WdsPackCollection
@ stub WdsPublish
@ stub WdsPublishEx
-@ stub WdsPublishImmediateAsynch
+@ stub WdsPublishImmediateAsync
@ stub WdsPublishImmediateEx
@ stub WdsPublishOffline
@ stub WdsSeqAlloc
@@ -150,8 +150,8 @@
@ stub WdsSetUILanguage
@ stub WdsSetupLogDestroy
@ stub WdsSetupLogInit
-@ stub WdsSetLogMessageA
-@ stub WdsSetLogMessageW
+@ stub WdsSetupLogMessageA
+@ stub WdsSetupLogMessageW
@ stub WdsSubscribeEx
@ stub WdsTerminate
@ stub WdsUnlockExecutionGroup
--
2.35.0
Jan. 31, 2022
[PATCH v6 1/4] wdscore: Implement CurrentIP.
by Mohamad Al-Jaf
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51850
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
v6: - Use __ASM_GLOBAL_FUNC instead of __ASM_STDCALL_FUNC.
- Use cdecl instead of stdcall in wdscore.spec.
---
configure.ac | 1 +
dlls/wdscore/Makefile.in | 3 ++
dlls/wdscore/main.c | 56 ++++++++++++++++++++++++++++
dlls/wdscore/tests/Makefile.in | 4 ++
dlls/wdscore/tests/main.c | 65 +++++++++++++++++++++++++++++++++
dlls/wdscore/wdscore.spec | 2 +-
dlls/wdscore/wdscore_internal.h | 24 ++++++++++++
7 files changed, 154 insertions(+), 1 deletion(-)
create mode 100644 dlls/wdscore/main.c
create mode 100644 dlls/wdscore/tests/Makefile.in
create mode 100644 dlls/wdscore/tests/main.c
create mode 100644 dlls/wdscore/wdscore_internal.h
diff --git a/configure.ac b/configure.ac
index 0b1a53f3ff9..1923c95f4b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3345,6 +3345,7 @@ WINE_CONFIG_MAKEFILE(dlls/wbemdisp/tests)
WINE_CONFIG_MAKEFILE(dlls/wbemprox)
WINE_CONFIG_MAKEFILE(dlls/wbemprox/tests)
WINE_CONFIG_MAKEFILE(dlls/wdscore)
+WINE_CONFIG_MAKEFILE(dlls/wdscore/tests)
WINE_CONFIG_MAKEFILE(dlls/webservices)
WINE_CONFIG_MAKEFILE(dlls/webservices/tests)
WINE_CONFIG_MAKEFILE(dlls/websocket)
diff --git a/dlls/wdscore/Makefile.in b/dlls/wdscore/Makefile.in
index 20ba1d3b1c9..2020e72c7bb 100644
--- a/dlls/wdscore/Makefile.in
+++ b/dlls/wdscore/Makefile.in
@@ -1,3 +1,6 @@
MODULE = wdscore.dll
EXTRADLLFLAGS = -Wb,--prefer-native
+
+C_SRCS = \
+ main.c
diff --git a/dlls/wdscore/main.c b/dlls/wdscore/main.c
new file mode 100644
index 00000000000..1ed00206adf
--- /dev/null
+++ b/dlls/wdscore/main.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2022 Mohamad Al-Jaf
+ *
+ * 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
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+
+#include "wine/asm.h"
+#include "wine/debug.h"
+
+#include "wdscore_internal.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wdscore);
+
+/***********************************************************************
+ * CurrentIP (wdscore.@)
+ */
+#ifdef __i386__
+__ASM_GLOBAL_FUNC(CurrentIP,
+ "movl (%esp), %eax\n\t"
+ "ret" )
+#elif defined(__x86_64__)
+__ASM_GLOBAL_FUNC(CurrentIP,
+ "movq (%rsp), %rax\n\t"
+ "ret" )
+#elif defined(__arm__)
+__ASM_GLOBAL_FUNC(CurrentIP,
+ "mov r0, lr\n\t"
+ "bx lr" )
+#elif defined(__aarch64__)
+__ASM_GLOBAL_FUNC(CurrentIP,
+ "mov x0, lr\n\t"
+ "ret" )
+#else
+void *CurrentIP(void)
+{
+ FIXME( "not implemented\n" );
+ return 0;
+}
+#endif
diff --git a/dlls/wdscore/tests/Makefile.in b/dlls/wdscore/tests/Makefile.in
new file mode 100644
index 00000000000..baf4adf23a1
--- /dev/null
+++ b/dlls/wdscore/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = wdscore.dll
+
+C_SRCS = \
+ main.c
diff --git a/dlls/wdscore/tests/main.c b/dlls/wdscore/tests/main.c
new file mode 100644
index 00000000000..f17abbbdb3f
--- /dev/null
+++ b/dlls/wdscore/tests/main.c
@@ -0,0 +1,65 @@
+/*
+ * Unit test suite for wdscore
+ *
+ * Copyright 2022 Mohamad Al-Jaf
+ *
+ * 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
+ *
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+
+#include "wine/test.h"
+
+static HMODULE dll;
+static void* (*pCurrentIP)(void);
+
+static BOOL init_function_pointers(void)
+{
+ dll = LoadLibraryA("wdscore.dll");
+
+ if (dll)
+ {
+ pCurrentIP = (void*)GetProcAddress(dll, "CurrentIP");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void test_CurrentIP(void)
+{
+ char *cur;
+ char *ret;
+
+ cur = (char*)&test_CurrentIP;
+ ret = (char*)pCurrentIP();
+
+ ok(cur <= ret && ret < (cur + 0x100), "Address %p not in function starting at %p.\n", ret, cur);
+}
+
+START_TEST(main)
+{
+ if (init_function_pointers())
+ {
+ test_CurrentIP();
+ FreeLibrary(dll);
+ }
+ else
+ skip("could not load wdscore.dll\n");
+}
diff --git a/dlls/wdscore/wdscore.spec b/dlls/wdscore/wdscore.spec
index 15958b86aba..c292f65505b 100644
--- a/dlls/wdscore/wdscore.spec
+++ b/dlls/wdscore/wdscore.spec
@@ -71,7 +71,7 @@
@ stub ConstructPartialMsgIfW
@ stub ConstructPartialMsgVA
@ stub ConstructPartialMsgVW
-@ stub CurrentIP
+@ cdecl CurrentIP()
@ stub EndMajorTask
@ stub EndMinorTask
@ stub GetMajorTask
diff --git a/dlls/wdscore/wdscore_internal.h b/dlls/wdscore/wdscore_internal.h
new file mode 100644
index 00000000000..595ce93a3e7
--- /dev/null
+++ b/dlls/wdscore/wdscore_internal.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2022 Mohamad Al-Jaf
+ *
+ * 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
+ */
+
+#ifndef __WDSCORE_INTERNAL_H
+#define __WDSCORE_INTERNAL_H
+
+void *CurrentIP(void);
+
+#endif /* __WDSCORE_INTERNAL_H */
--
2.35.0
Jan. 31, 2022
[PATCH 5/5] hid: Use msvcrt allocation functions.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/hid/hidd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c
index bf5874d05ab..a82ba8392a1 100644
--- a/dlls/hid/hidd.c
+++ b/dlls/hid/hidd.c
@@ -21,6 +21,7 @@
#include <stdarg.h>
+#include <stdlib.h>
#include "wine/debug.h"
@@ -55,7 +56,7 @@ static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void
BOOLEAN WINAPI HidD_FreePreparsedData( PHIDP_PREPARSED_DATA preparsed_data )
{
TRACE( "preparsed_data %p.\n", preparsed_data );
- HeapFree( GetProcessHeap(), 0, preparsed_data );
+ free( preparsed_data );
return TRUE;
}
@@ -142,11 +143,11 @@ BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE file, PHIDP_PREPARSED_DATA *prepars
if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(info) ))
return FALSE;
- if (!(data = HeapAlloc(GetProcessHeap(), 0, info.DescriptorSize))) return FALSE;
+ if (!(data = malloc( info.DescriptorSize ))) return FALSE;
if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, data, info.DescriptorSize ))
{
- HeapFree( GetProcessHeap(), 0, data );
+ free( data );
return FALSE;
}
*preparsed_data = data;
--
2.34.1
Jan. 31, 2022
[PATCH 4/5] hid: Fix printf format warnings with long types.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/hid/Makefile.in | 1 -
dlls/hid/hidd.c | 88 ++++++++++++++++++++++----------------------
dlls/hid/hidp.c | 45 +++++++++++-----------
3 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/dlls/hid/Makefile.in b/dlls/hid/Makefile.in
index 177a1a0c3e7..8bad2ec00de 100644
--- a/dlls/hid/Makefile.in
+++ b/dlls/hid/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = hid.dll
IMPORTLIB = hid
diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c
index 684ad5b5df8..bf5874d05ab 100644
--- a/dlls/hid/hidd.c
+++ b/dlls/hid/hidd.c
@@ -52,116 +52,116 @@ static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void
return ret;
}
-BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData)
+BOOLEAN WINAPI HidD_FreePreparsedData( PHIDP_PREPARSED_DATA preparsed_data )
{
- TRACE("(%p)\n", PreparsedData);
- HeapFree(GetProcessHeap(), 0, PreparsedData);
+ TRACE( "preparsed_data %p.\n", preparsed_data );
+ HeapFree( GetProcessHeap(), 0, preparsed_data );
return TRUE;
}
-BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr)
+BOOLEAN WINAPI HidD_GetAttributes( HANDLE file, PHIDD_ATTRIBUTES attributes )
{
HID_COLLECTION_INFORMATION info;
BOOLEAN ret;
- TRACE("(%p %p)\n", HidDeviceObject, Attr);
+ TRACE( "file %p, attributes %p.\n", file, attributes );
- ret = sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(HID_COLLECTION_INFORMATION));
+ ret = sync_ioctl( file, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(HID_COLLECTION_INFORMATION) );
if (ret)
{
- Attr->Size = sizeof(HIDD_ATTRIBUTES);
- Attr->VendorID = info.VendorID;
- Attr->ProductID = info.ProductID;
- Attr->VersionNumber = info.VersionNumber;
+ attributes->Size = sizeof(HIDD_ATTRIBUTES);
+ attributes->VendorID = info.VendorID;
+ attributes->ProductID = info.ProductID;
+ attributes->VersionNumber = info.VersionNumber;
}
return ret;
}
-BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength)
+BOOLEAN WINAPI HidD_GetFeature( HANDLE file, void *report_buf, ULONG report_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_FEATURE, NULL, 0, ReportBuffer, ReportBufferLength);
+ TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
+ return sync_ioctl( file, IOCTL_HID_GET_FEATURE, NULL, 0, report_buf, report_len );
}
void WINAPI HidD_GetHidGuid(LPGUID guid)
{
- TRACE("(%p)\n", guid);
+ TRACE( "guid %s.\n", debugstr_guid( guid ) );
*guid = GUID_DEVINTERFACE_HID;
}
-BOOLEAN WINAPI HidD_GetInputReport(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength)
+BOOLEAN WINAPI HidD_GetInputReport( HANDLE file, void *report_buf, ULONG report_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_INPUT_REPORT, NULL, 0, ReportBuffer, ReportBufferLength);
+ TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
+ return sync_ioctl( file, IOCTL_HID_GET_INPUT_REPORT, NULL, 0, report_buf, report_len );
}
-BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength)
+BOOLEAN WINAPI HidD_GetManufacturerString( HANDLE file, void *buffer, ULONG buffer_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_MANUFACTURER_STRING, NULL, 0, Buffer, BufferLength);
+ TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
+ return sync_ioctl( file, IOCTL_HID_GET_MANUFACTURER_STRING, NULL, 0, buffer, buffer_len );
}
-BOOLEAN WINAPI HidD_GetNumInputBuffers(HANDLE HidDeviceObject, ULONG *NumberBuffers)
+BOOLEAN WINAPI HidD_GetNumInputBuffers( HANDLE file, ULONG *num_buffer )
{
- TRACE("(%p %p)\n", HidDeviceObject, NumberBuffers);
- return sync_ioctl(HidDeviceObject, IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS, NULL, 0, NumberBuffers, sizeof(*NumberBuffers));
+ TRACE( "file %p, num_buffer %p.\n", file, num_buffer );
+ return sync_ioctl( file, IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS, NULL, 0, num_buffer, sizeof(*num_buffer) );
}
-BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength)
+BOOLEAN WINAPI HidD_SetFeature( HANDLE file, void *report_buf, ULONG report_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_SET_FEATURE, ReportBuffer, ReportBufferLength, NULL, 0);
+ TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
+ return sync_ioctl( file, IOCTL_HID_SET_FEATURE, report_buf, report_len, NULL, 0 );
}
-BOOLEAN WINAPI HidD_SetNumInputBuffers(HANDLE HidDeviceObject, ULONG NumberBuffers)
+BOOLEAN WINAPI HidD_SetNumInputBuffers( HANDLE file, ULONG num_buffer )
{
- TRACE("(%p %i)\n", HidDeviceObject, NumberBuffers);
- return sync_ioctl(HidDeviceObject, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &NumberBuffers, sizeof(NumberBuffers), NULL, 0);
+ TRACE( "file %p, num_buffer %lu.\n", file, num_buffer );
+ return sync_ioctl( file, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &num_buffer, sizeof(num_buffer), NULL, 0 );
}
-BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength)
+BOOLEAN WINAPI HidD_GetProductString( HANDLE file, void *buffer, ULONG buffer_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, Buffer, BufferLength);
+ TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
+ return sync_ioctl( file, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, buffer, buffer_len );
}
-BOOLEAN WINAPI HidD_GetSerialNumberString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength)
+BOOLEAN WINAPI HidD_GetSerialNumberString( HANDLE file, void *buffer, ULONG buffer_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_SERIALNUMBER_STRING, NULL, 0, Buffer, BufferLength);
+ TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
+ return sync_ioctl( file, IOCTL_HID_GET_SERIALNUMBER_STRING, NULL, 0, buffer, buffer_len );
}
-BOOLEAN WINAPI HidD_GetPreparsedData(HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData)
+BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE file, PHIDP_PREPARSED_DATA *preparsed_data )
{
HID_COLLECTION_INFORMATION info;
PHIDP_PREPARSED_DATA data;
- TRACE("(%p %p)\n", HidDeviceObject, PreparsedData);
+ TRACE( "file %p, preparsed_data %p.\n", file, preparsed_data );
- if (!sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(info)))
+ if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(info) ))
return FALSE;
if (!(data = HeapAlloc(GetProcessHeap(), 0, info.DescriptorSize))) return FALSE;
- if (!sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, data, info.DescriptorSize))
+ if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, data, info.DescriptorSize ))
{
HeapFree( GetProcessHeap(), 0, data );
return FALSE;
}
- *PreparsedData = data;
+ *preparsed_data = data;
return TRUE;
}
-BOOLEAN WINAPI HidD_SetOutputReport(HANDLE HidDeviceObject, void *ReportBuffer, ULONG ReportBufferLength)
+BOOLEAN WINAPI HidD_SetOutputReport( HANDLE file, void *report_buf, ULONG report_len )
{
- TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
- return sync_ioctl(HidDeviceObject, IOCTL_HID_SET_OUTPUT_REPORT, ReportBuffer, ReportBufferLength, NULL, 0);
+ TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
+ return sync_ioctl( file, IOCTL_HID_SET_OUTPUT_REPORT, report_buf, report_len, NULL, 0 );
}
BOOLEAN WINAPI HidD_GetIndexedString(HANDLE file, ULONG index, void *buffer, ULONG length)
{
- TRACE("file %p, index %u, buffer %p, length %u.\n", file, index, buffer, length);
+ TRACE( "file %p, index %lu, buffer %p, length %lu.\n", file, index, buffer, length );
return sync_ioctl(file, IOCTL_HID_GET_INDEXED_STRING, &index, sizeof(index), buffer, length);
}
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c
index ed2fa3906bd..a1c5805c19f 100644
--- a/dlls/hid/hidp.c
+++ b/dlls/hid/hidp.c
@@ -270,7 +270,7 @@ NTSTATUS WINAPI HidP_GetScaledUsageValue( HIDP_REPORT_TYPE report_type, USAGE us
struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage };
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value %p, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value %p, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value, preparsed_data, report_buf, report_len );
*value = 0;
@@ -303,7 +303,7 @@ NTSTATUS WINAPI HidP_GetUsageValue( HIDP_REPORT_TYPE report_type, USAGE usage_pa
struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value %p, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value %p, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -321,8 +321,8 @@ NTSTATUS WINAPI HidP_GetUsageValueArray( HIDP_REPORT_TYPE report_type, USAGE usa
struct caps_filter filter = {.values = TRUE, .array = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value_buf %p, value_len %u, "
- "preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value_buf %p, value_len %u, "
+ "preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value_buf, value_len, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -383,8 +383,9 @@ NTSTATUS WINAPI HidP_GetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page,
NTSTATUS status;
USHORT limit = -1;
- TRACE( "report_type %d, collection %d, usages %p, usages_len %p, preparsed_data %p, report_buf %p, report_len %u.\n",
- report_type, collection, usages, usages_len, preparsed_data, report_buf, report_len );
+ TRACE( "report_type %d, usage_page %u, collection %u, usages %p, usages_len %p, preparsed_data %p, "
+ "report_buf %p, report_len %lu.\n",
+ report_type, usage_page, collection, usages, usages_len, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -410,7 +411,7 @@ NTSTATUS WINAPI HidP_InitializeReportForID( HIDP_REPORT_TYPE report_type, UCHAR
const struct hid_value_caps *caps, *end;
NTSTATUS status;
- TRACE( "report_type %d, report_id %x, preparsed_data %p, report_buf %p, report_len %u.\n", report_type,
+ TRACE( "report_type %d, report_id %u, preparsed_data %p, report_buf %p, report_len %lu.\n", report_type,
report_id, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -439,7 +440,7 @@ ULONG WINAPI HidP_MaxUsageListLength( HIDP_REPORT_TYPE report_type, USAGE usage_
USHORT limit = -1;
ULONG count = 0;
- TRACE( "report_type %d, usage_page %x, preparsed_data %p.\n", report_type, usage_page, preparsed_data );
+ TRACE( "report_type %d, usage_page %u, preparsed_data %p.\n", report_type, usage_page, preparsed_data );
enum_value_caps( preparsed, report_type, 0, &filter, get_usage_list_length, &count, &limit );
return count;
@@ -485,7 +486,7 @@ NTSTATUS WINAPI HidP_SetScaledUsageValue( HIDP_REPORT_TYPE report_type, USAGE us
struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage };
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value %d, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value %ld, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -516,7 +517,7 @@ NTSTATUS WINAPI HidP_SetUsageValue( HIDP_REPORT_TYPE report_type, USAGE usage_pa
struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value %u, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value %lu, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -534,8 +535,8 @@ NTSTATUS WINAPI HidP_SetUsageValueArray( HIDP_REPORT_TYPE report_type, USAGE usa
struct caps_filter filter = {.values = TRUE, .array = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
USHORT count = 1;
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, value_buf %p, value_len %u, "
- "preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, value_buf %p, value_len %u, "
+ "preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usage, value_buf, value_len, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -590,8 +591,8 @@ NTSTATUS WINAPI HidP_SetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page,
USHORT limit = 1;
ULONG i, count = *usage_count;
- TRACE( "report_type %d, usage_page %x, collection %d, usages %p, usage_count %p, preparsed_data %p, "
- "report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usages %p, usage_count %p, preparsed_data %p, "
+ "report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usages, usage_count, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -656,8 +657,8 @@ NTSTATUS WINAPI HidP_UnsetUsages( HIDP_REPORT_TYPE report_type, USAGE usage_page
USHORT limit = 1;
ULONG i, count = *usage_count;
- TRACE( "report_type %d, usage_page %x, collection %d, usages %p, usage_count %p, preparsed_data %p, "
- "report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usages %p, usage_count %p, preparsed_data %p, "
+ "report_buf %p, report_len %lu.\n",
report_type, usage_page, collection, usages, usage_count, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -679,8 +680,8 @@ NTSTATUS WINAPI HidP_TranslateUsagesToI8042ScanCodes(USAGE *ChangedUsageList,
HIDP_KEYBOARD_MODIFIER_STATE *ModifierState,
PHIDP_INSERT_SCANCODES InsertCodesProcedure, VOID *InsertCodesContext)
{
- FIXME("stub: %p, %i, %i, %p, %p, %p\n", ChangedUsageList, UsageListLength,
- KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext);
+ FIXME( "ChangedUsageList %p, UsageListLength %lu, KeyAction %u, ModifierState %p, InsertCodesProcedure %p, InsertCodesContext %p stub!\n",
+ ChangedUsageList, UsageListLength, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext );
return STATUS_NOT_IMPLEMENTED;
}
@@ -736,7 +737,7 @@ NTSTATUS WINAPI HidP_GetSpecificButtonCaps( HIDP_REPORT_TYPE report_type, USAGE
struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data;
const struct caps_filter filter = {.buttons = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, caps %p, caps_count %p, preparsed_data %p.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, caps %p, caps_count %p, preparsed_data %p.\n",
report_type, usage_page, collection, usage, caps, caps_count, preparsed_data );
return enum_value_caps( preparsed, report_type, 0, &filter, get_button_caps, &caps, caps_count );
@@ -803,7 +804,7 @@ NTSTATUS WINAPI HidP_GetSpecificValueCaps( HIDP_REPORT_TYPE report_type, USAGE u
struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)preparsed_data;
const struct caps_filter filter = {.values = TRUE, .usage_page = usage_page, .collection = collection, .usage = usage};
- TRACE( "report_type %d, usage_page %x, collection %d, usage %x, caps %p, caps_count %p, preparsed_data %p.\n",
+ TRACE( "report_type %d, usage_page %u, collection %u, usage %u, caps %p, caps_count %p, preparsed_data %p.\n",
report_type, usage_page, collection, usage, caps, caps_count, preparsed_data );
return enum_value_caps( preparsed, report_type, 0, &filter, get_value_caps, &caps, caps_count );
@@ -868,7 +869,7 @@ NTSTATUS WINAPI HidP_GetUsagesEx( HIDP_REPORT_TYPE report_type, USHORT collectio
NTSTATUS status;
USHORT limit = -1;
- TRACE( "report_type %d, collection %d, usages %p, usages_len %p, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, collection %u, usages %p, usages_len %p, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, collection, usages, usages_len, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
@@ -980,7 +981,7 @@ NTSTATUS WINAPI HidP_GetData( HIDP_REPORT_TYPE report_type, HIDP_DATA *data, ULO
NTSTATUS status;
USHORT limit = -1;
- TRACE( "report_type %d, data %p, data_len %p, preparsed_data %p, report_buf %p, report_len %u.\n",
+ TRACE( "report_type %d, data %p, data_len %p, preparsed_data %p, report_buf %p, report_len %lu.\n",
report_type, data, data_len, preparsed_data, report_buf, report_len );
if (!report_len) return HIDP_STATUS_INVALID_REPORT_LENGTH;
--
2.34.1
Jan. 31, 2022
[PATCH 3/5] winebus.sys: Fix warnings with long integer types.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/winebus.sys/Makefile.in | 1 -
dlls/winebus.sys/bus_iohid.c | 2 +-
dlls/winebus.sys/bus_sdl.c | 2 +-
dlls/winebus.sys/bus_udev.c | 10 ++++-----
dlls/winebus.sys/hid.c | 2 +-
dlls/winebus.sys/main.c | 36 ++++++++++++++++-----------------
dlls/winebus.sys/unix_private.h | 10 ++++-----
dlls/winebus.sys/unixlib.c | 4 ++--
dlls/winebus.sys/unixlib.h | 16 +++++++--------
9 files changed, 41 insertions(+), 42 deletions(-)
diff --git a/dlls/winebus.sys/Makefile.in b/dlls/winebus.sys/Makefile.in
index 6eaaa248c0c..d9ea33d267d 100644
--- a/dlls/winebus.sys/Makefile.in
+++ b/dlls/winebus.sys/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winebus.sys
UNIXLIB = winebus.so
IMPORTS = ntoskrnl hidparse
diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index 735fd8c54cc..e0527739199 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -183,7 +183,7 @@ static void iohid_device_stop(struct unix_device *iface)
}
static NTSTATUS iohid_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer,
- DWORD length, DWORD *out_length)
+ UINT length, UINT *out_length)
{
struct iohid_device *impl = impl_from_unix_device(iface);
CFDataRef data = IOHIDDeviceGetProperty(impl->device, CFSTR(kIOHIDReportDescriptorKey));
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 37d75d0bc95..eba8a959cb4 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -400,7 +400,7 @@ static void sdl_device_stop(struct unix_device *iface)
pthread_mutex_unlock(&sdl_cs);
}
-NTSTATUS sdl_device_haptics_start(struct unix_device *iface, DWORD duration_ms,
+NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
USHORT rumble_intensity, USHORT buzz_intensity)
{
struct sdl_device *impl = impl_from_unix_device(iface);
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index c6185adf23d..9881b625086 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -296,7 +296,7 @@ static void hidraw_device_stop(struct unix_device *iface)
}
static NTSTATUS hidraw_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer,
- DWORD length, DWORD *out_length)
+ UINT length, UINT *out_length)
{
#ifdef HAVE_LINUX_HIDRAW_H
struct hidraw_report_descriptor descriptor;
@@ -415,7 +415,7 @@ static void hidraw_disable_sony_quirks(struct unix_device *iface)
static void hidraw_device_set_output_report(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
{
struct hidraw_device *impl = hidraw_impl_from_unix_device(iface);
- ULONG length = packet->reportBufferLen;
+ unsigned int length = packet->reportBufferLen;
BYTE buffer[8192];
int count = 0;
@@ -448,7 +448,7 @@ static void hidraw_device_get_feature_report(struct unix_device *iface, HID_XFER
{
#if defined(HAVE_LINUX_HIDRAW_H) && defined(HIDIOCGFEATURE)
struct hidraw_device *impl = hidraw_impl_from_unix_device(iface);
- ULONG length = packet->reportBufferLen;
+ unsigned int length = packet->reportBufferLen;
BYTE buffer[8192];
int count = 0;
@@ -485,7 +485,7 @@ static void hidraw_device_set_feature_report(struct unix_device *iface, HID_XFER
{
#if defined(HAVE_LINUX_HIDRAW_H) && defined(HIDIOCSFEATURE)
struct hidraw_device *impl = hidraw_impl_from_unix_device(iface);
- ULONG length = packet->reportBufferLen;
+ unsigned int length = packet->reportBufferLen;
BYTE buffer[8192];
int count = 0;
@@ -865,7 +865,7 @@ static void lnxev_device_read_report(struct unix_device *iface)
bus_event_queue_input_report(&event_queue, iface, state->report_buf, state->report_len);
}
-static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, DWORD duration_ms,
+static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT duration_ms,
USHORT rumble_intensity, USHORT buzz_intensity)
{
struct lnxev_device *impl = lnxev_impl_from_unix_device(iface);
diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c
index 32628f1f2fd..3be2ca304d5 100644
--- a/dlls/winebus.sys/hid.c
+++ b/dlls/winebus.sys/hid.c
@@ -1025,7 +1025,7 @@ static void hid_device_stop(struct unix_device *iface)
iface->hid_vtbl->stop(iface);
}
-NTSTATUS hid_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer, DWORD length, DWORD *out_length)
+NTSTATUS hid_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer, UINT length, UINT *out_length)
{
*out_length = iface->hid_report_descriptor.size;
if (length < iface->hid_report_descriptor.size) return STATUS_BUFFER_TOO_SMALL;
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 111953c3bae..d1eec8c29bb 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -79,7 +79,7 @@ struct device_extension
DWORD index;
BYTE *report_desc;
- ULONG report_desc_length;
+ UINT report_desc_length;
HIDP_DEVICE_DESC collection_desc;
struct hid_report *last_reports[256];
@@ -120,7 +120,7 @@ static NTSTATUS unix_device_start(DEVICE_OBJECT *device)
return winebus_call(device_start, ext->unix_device);
}
-static NTSTATUS unix_device_get_report_descriptor(DEVICE_OBJECT *device, BYTE *buffer, DWORD length, DWORD *out_length)
+static NTSTATUS unix_device_get_report_descriptor(DEVICE_OBJECT *device, BYTE *buffer, UINT length, UINT *out_length)
{
struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
struct device_descriptor_params params =
@@ -299,7 +299,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni
status = IoCreateDevice(driver_obj, sizeof(struct device_extension), &nameW, 0, 0, FALSE, &device);
if (status)
{
- FIXME("failed to create device error %x\n", status);
+ FIXME("failed to create device error %#lx\n", status);
return NULL;
}
@@ -413,7 +413,7 @@ static BOOL deliver_next_report(struct device_extension *ext, IRP *irp)
if (TRACE_ON(hid))
{
- TRACE("read input report length %u:\n", report->length);
+ TRACE("read input report length %lu:\n", report->length);
for (i = 0; i < report->length;)
{
char buffer[256], *buf = buffer;
@@ -558,7 +558,7 @@ static DWORD CALLBACK bus_main_thread(void *args)
TRACE("%s main loop started\n", debugstr_w(bus.name));
bus.bus_event->type = BUS_EVENT_TYPE_NONE;
- if (status) WARN("%s bus init returned status %#x\n", debugstr_w(bus.name), status);
+ if (status) WARN("%s bus init returned status %#lx\n", debugstr_w(bus.name), status);
else while ((status = winebus_call(bus.wait_code, bus.bus_event)) == STATUS_PENDING)
{
struct bus_event *event = bus.bus_event;
@@ -592,7 +592,7 @@ static DWORD CALLBACK bus_main_thread(void *args)
}
}
- if (status) WARN("%s bus wait returned status %#x\n", debugstr_w(bus.name), status);
+ if (status) WARN("%s bus wait returned status %#lx\n", debugstr_w(bus.name), status);
else TRACE("%s main loop exited\n", debugstr_w(bus.name));
RtlFreeHeap(GetProcessHeap(), 0, bus.bus_event);
return status;
@@ -837,20 +837,20 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp)
if (ext->state != DEVICE_STATE_STOPPED) status = STATUS_SUCCESS;
else if (ext->state == DEVICE_STATE_REMOVED) status = STATUS_DELETE_PENDING;
else if ((status = unix_device_start(device)))
- ERR("Failed to start device %p, status %#x\n", device, status);
+ ERR("Failed to start device %p, status %#lx\n", device, status);
else
{
status = unix_device_get_report_descriptor(device, NULL, 0, &ext->report_desc_length);
if (status != STATUS_SUCCESS && status != STATUS_BUFFER_TOO_SMALL)
- ERR("Failed to get device %p report descriptor, status %#x\n", device, status);
+ ERR("Failed to get device %p report descriptor, status %#lx\n", device, status);
else if (!(ext->report_desc = RtlAllocateHeap(GetProcessHeap(), 0, ext->report_desc_length)))
status = STATUS_NO_MEMORY;
else if ((status = unix_device_get_report_descriptor(device, ext->report_desc, ext->report_desc_length,
&ext->report_desc_length)))
- ERR("Failed to get device %p report descriptor, status %#x\n", device, status);
+ ERR("Failed to get device %p report descriptor, status %#lx\n", device, status);
else if ((status = HidP_GetCollectionDescription(ext->report_desc, ext->report_desc_length,
PagedPool, &ext->collection_desc)) != HIDP_STATUS_SUCCESS)
- ERR("Failed to parse device %p report descriptor, status %#x\n", device, status);
+ ERR("Failed to parse device %p report descriptor, status %#lx\n", device, status);
else
{
status = STATUS_SUCCESS;
@@ -1032,7 +1032,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
break;
case IOCTL_HID_GET_STRING:
{
- DWORD index = (ULONG_PTR)irpsp->Parameters.DeviceIoControl.Type3InputBuffer;
+ UINT index = (UINT_PTR)irpsp->Parameters.DeviceIoControl.Type3InputBuffer;
TRACE("IOCTL_HID_GET_STRING[%08x]\n", index);
irp->IoStatus.Status = hid_get_device_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len);
@@ -1050,7 +1050,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Status = STATUS_SUCCESS;
if (TRACE_ON(hid))
{
- TRACE("read input report id %u length %u:\n", packet->reportId, packet->reportBufferLen);
+ TRACE("read input report id %u length %lu:\n", packet->reportId, packet->reportBufferLen);
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
@@ -1080,7 +1080,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
HID_XFER_PACKET *packet = (HID_XFER_PACKET *)irp->UserBuffer;
if (TRACE_ON(hid))
{
- TRACE("write output report id %u length %u:\n", packet->reportId, packet->reportBufferLen);
+ TRACE("write output report id %u length %lu:\n", packet->reportId, packet->reportBufferLen);
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
@@ -1099,7 +1099,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
unix_device_get_feature_report(device, packet, &irp->IoStatus);
if (!irp->IoStatus.Status && TRACE_ON(hid))
{
- TRACE("read feature report id %u length %u:\n", packet->reportId, packet->reportBufferLen);
+ TRACE("read feature report id %u length %lu:\n", packet->reportId, packet->reportBufferLen);
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
@@ -1116,7 +1116,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
HID_XFER_PACKET *packet = (HID_XFER_PACKET *)irp->UserBuffer;
if (TRACE_ON(hid))
{
- TRACE("write feature report id %u length %u:\n", packet->reportId, packet->reportBufferLen);
+ TRACE("write feature report id %u length %lu:\n", packet->reportId, packet->reportBufferLen);
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
@@ -1130,7 +1130,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
break;
}
default:
- FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n",
+ FIXME("Unsupported ioctl %lx (device=%lx access=%lx func=%lx method=%lx)\n",
code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3);
break;
}
@@ -1150,7 +1150,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *p
if ((ret = IoCreateDevice(driver, 0, NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &bus_fdo)))
{
- ERR("Failed to create FDO, status %#x.\n", ret);
+ ERR("Failed to create FDO, status %#lx.\n", ret);
return ret;
}
@@ -1183,7 +1183,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
attr.ObjectName = path;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE;
if ((ret = NtOpenKey(&driver_key, KEY_ALL_ACCESS, &attr)) != STATUS_SUCCESS)
- ERR("Failed to open driver key, status %#x.\n", ret);
+ ERR("Failed to open driver key, status %#lx.\n", ret);
driver_obj = driver;
diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h
index e897251dea8..ff57e537ffe 100644
--- a/dlls/winebus.sys/unix_private.h
+++ b/dlls/winebus.sys/unix_private.h
@@ -94,7 +94,7 @@ struct raw_device_vtbl
void (*destroy)(struct unix_device *iface);
NTSTATUS (*start)(struct unix_device *iface);
void (*stop)(struct unix_device *iface);
- NTSTATUS (*get_report_descriptor)(struct unix_device *iface, BYTE *buffer, DWORD length, DWORD *out_length);
+ NTSTATUS (*get_report_descriptor)(struct unix_device *iface, BYTE *buffer, UINT length, UINT *out_length);
void (*set_output_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
void (*get_feature_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
void (*set_feature_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
@@ -105,7 +105,7 @@ struct hid_device_vtbl
void (*destroy)(struct unix_device *iface);
NTSTATUS (*start)(struct unix_device *iface);
void (*stop)(struct unix_device *iface);
- NTSTATUS (*haptics_start)(struct unix_device *iface, DWORD duration_ms,
+ NTSTATUS (*haptics_start)(struct unix_device *iface, UINT duration_ms,
USHORT rumble_intensity, USHORT buzz_intensity);
NTSTATUS (*physical_device_control)(struct unix_device *iface, USAGE control);
NTSTATUS (*physical_device_set_gain)(struct unix_device *iface, BYTE percent);
@@ -132,9 +132,9 @@ enum haptics_waveform_index
struct hid_haptics_features
{
- WORD waveform_list[HAPTICS_WAVEFORM_LAST_INDEX - HAPTICS_WAVEFORM_NULL_INDEX];
- WORD duration_list[HAPTICS_WAVEFORM_LAST_INDEX - HAPTICS_WAVEFORM_NULL_INDEX];
- DWORD waveform_cutoff_time_ms;
+ WORD waveform_list[HAPTICS_WAVEFORM_LAST_INDEX - HAPTICS_WAVEFORM_NULL_INDEX];
+ WORD duration_list[HAPTICS_WAVEFORM_LAST_INDEX - HAPTICS_WAVEFORM_NULL_INDEX];
+ UINT waveform_cutoff_time_ms;
};
struct hid_haptics_waveform
diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c
index 3a7c3a16428..96bd41e67f7 100644
--- a/dlls/winebus.sys/unixlib.c
+++ b/dlls/winebus.sys/unixlib.c
@@ -101,7 +101,7 @@ static void mouse_stop(struct unix_device *iface)
{
}
-static NTSTATUS mouse_haptics_start(struct unix_device *iface, DWORD duration,
+static NTSTATUS mouse_haptics_start(struct unix_device *iface, UINT duration,
USHORT rumble_intensity, USHORT buzz_intensity)
{
return STATUS_NOT_SUPPORTED;
@@ -184,7 +184,7 @@ static void keyboard_stop(struct unix_device *iface)
{
}
-static NTSTATUS keyboard_haptics_start(struct unix_device *iface, DWORD duration,
+static NTSTATUS keyboard_haptics_start(struct unix_device *iface, UINT duration,
USHORT rumble_intensity, USHORT buzz_intensity)
{
return STATUS_NOT_SUPPORTED;
diff --git a/dlls/winebus.sys/unixlib.h b/dlls/winebus.sys/unixlib.h
index 11a4efac36e..a84a3331a25 100644
--- a/dlls/winebus.sys/unixlib.h
+++ b/dlls/winebus.sys/unixlib.h
@@ -32,11 +32,11 @@
struct device_desc
{
- DWORD vid;
- DWORD pid;
- DWORD version;
- DWORD input;
- DWORD uid;
+ UINT vid;
+ UINT pid;
+ UINT version;
+ UINT input;
+ UINT uid;
BOOL is_gamepad;
WCHAR manufacturer[MAX_PATH];
@@ -48,7 +48,7 @@ struct sdl_bus_options
{
BOOL map_controllers;
/* freed after bus_init */
- DWORD mappings_count;
+ UINT mappings_count;
char **mappings;
};
@@ -104,8 +104,8 @@ struct device_descriptor_params
{
struct unix_device *iface;
BYTE *buffer;
- DWORD length;
- DWORD *out_length;
+ UINT length;
+ UINT *out_length;
};
struct device_report_params
--
2.34.1
Jan. 31, 2022
[PATCH 2/5] xinput1_3/tests: Fix printf warnings with long types.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/xinput1_3/tests/Makefile.in | 1 -
dlls/xinput1_3/tests/xinput.c | 143 ++++++++++++++++---------------
2 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/dlls/xinput1_3/tests/Makefile.in b/dlls/xinput1_3/tests/Makefile.in
index e326d5c1aac..260a8a634e4 100644
--- a/dlls/xinput1_3/tests/Makefile.in
+++ b/dlls/xinput1_3/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = xinput1_3.dll
IMPORTS = user32 hid setupapi
diff --git a/dlls/xinput1_3/tests/xinput.c b/dlls/xinput1_3/tests/xinput.c
index 60c5817c79a..5c31f0be1fe 100644
--- a/dlls/xinput1_3/tests/xinput.c
+++ b/dlls/xinput1_3/tests/xinput.c
@@ -68,7 +68,7 @@ static void test_set_state(void)
vibrator.wLeftMotorSpeed = 0;
vibrator.wRightMotorSpeed = 0;
result = pXInputSetState(controllerNum, &vibrator);
- ok(result == ERROR_SUCCESS, "XInputSetState failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS, "XInputSetState returned %lu\n", result);
/* Disabling XInput here, queueing a vibration and then re-enabling XInput
* is used to prove that vibrations are auto enabled when resuming XInput.
@@ -79,7 +79,7 @@ static void test_set_state(void)
vibrator.wLeftMotorSpeed = 65535;
vibrator.wRightMotorSpeed = 65535;
result = pXInputSetState(controllerNum, &vibrator);
- ok(result == ERROR_SUCCESS, "XInputSetState failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS, "XInputSetState returned %lu\n", result);
if (pXInputEnable) pXInputEnable(1);
Sleep(250);
@@ -87,11 +87,11 @@ static void test_set_state(void)
vibrator.wLeftMotorSpeed = 0;
vibrator.wRightMotorSpeed = 0;
result = pXInputSetState(controllerNum, &vibrator);
- ok(result == ERROR_SUCCESS, "XInputSetState failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS, "XInputSetState returned %lu\n", result);
}
result = pXInputSetState(XUSER_MAX_COUNT+1, &vibrator);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputSetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputSetState returned %lu\n", result);
}
static void test_get_state(void)
@@ -110,42 +110,42 @@ static void test_get_state(void)
else
result = pXInputGetStateEx(controllerNum, &state);
ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED,
- "%s failed with (%d)\n", i == 0 ? "XInputGetState" : "XInputGetStateEx", result);
+ "%s returned %lu\n", i == 0 ? "XInputGetState" : "XInputGetStateEx", result);
if (ERROR_DEVICE_NOT_CONNECTED == result)
{
- skip("Controller %d is not connected\n", controllerNum);
+ skip("Controller %lu is not connected\n", controllerNum);
continue;
}
- trace("-- Results for controller %d --\n", controllerNum);
+ trace("-- Results for controller %lu --\n", controllerNum);
if (i == 0)
{
good = controllerNum;
- trace("XInputGetState: %d\n", result);
+ trace("XInputGetState: %lu\n", result);
}
else
- trace("XInputGetStateEx: %d\n", result);
- trace("State->dwPacketNumber: %d\n", state.dwPacketNumber);
+ trace("XInputGetStateEx: %lu\n", result);
+ trace("State->dwPacketNumber: %lu\n", state.dwPacketNumber);
dump_gamepad(&state.Gamepad);
}
}
result = pXInputGetState(0, NULL);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned %lu\n", result);
result = pXInputGetState(XUSER_MAX_COUNT, &state);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned %lu\n", result);
result = pXInputGetState(XUSER_MAX_COUNT+1, &state);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned %lu\n", result);
if (pXInputGetStateEx)
{
result = pXInputGetStateEx(XUSER_MAX_COUNT, &state);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned %lu\n", result);
result = pXInputGetStateEx(XUSER_MAX_COUNT+1, &state);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned %lu\n", result);
}
if (winetest_interactive && good < XUSER_MAX_COUNT)
@@ -183,17 +183,17 @@ static void test_get_keystroke(void)
result = pXInputGetKeystroke(controllerNum, XINPUT_FLAG_GAMEPAD, &keystroke);
ok(result == ERROR_EMPTY || result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED,
- "XInputGetKeystroke failed with (%d)\n", result);
+ "XInputGetKeystroke returned %lu\n", result);
if (ERROR_DEVICE_NOT_CONNECTED == result)
{
- skip("Controller %d is not connected\n", controllerNum);
+ skip("Controller %lu is not connected\n", controllerNum);
}
}
ZeroMemory(&keystroke, sizeof(XINPUT_KEYSTROKE));
result = pXInputGetKeystroke(XUSER_MAX_COUNT+1, XINPUT_FLAG_GAMEPAD, &keystroke);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetKeystroke returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetKeystroke returned %lu\n", result);
}
static void test_get_capabilities(void)
@@ -207,11 +207,11 @@ static void test_get_capabilities(void)
ZeroMemory(&capabilities, sizeof(XINPUT_CAPABILITIES));
result = pXInputGetCapabilities(controllerNum, XINPUT_FLAG_GAMEPAD, &capabilities);
- ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetCapabilities failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetCapabilities returned %lu\n", result);
if (ERROR_DEVICE_NOT_CONNECTED == result)
{
- skip("Controller %d is not connected\n", controllerNum);
+ skip("Controller %lu is not connected\n", controllerNum);
continue;
}
@@ -221,7 +221,7 @@ static void test_get_capabilities(void)
ZeroMemory(&capabilities, sizeof(XINPUT_CAPABILITIES));
result = pXInputGetCapabilities(XUSER_MAX_COUNT+1, XINPUT_FLAG_GAMEPAD, &capabilities);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetCapabilities returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetCapabilities returned %lu\n", result);
}
static void test_get_dsoundaudiodevice(void)
@@ -236,11 +236,11 @@ static void test_get_dsoundaudiodevice(void)
{
soundRender = soundCapture = testGuid;
result = pXInputGetDSoundAudioDeviceGuids(controllerNum, &soundRender, &soundCapture);
- ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetDSoundAudioDeviceGuids failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetDSoundAudioDeviceGuids returned %lu\n", result);
if (ERROR_DEVICE_NOT_CONNECTED == result)
{
- skip("Controller %d is not connected\n", controllerNum);
+ skip("Controller %lu is not connected\n", controllerNum);
continue;
}
@@ -256,7 +256,7 @@ static void test_get_dsoundaudiodevice(void)
}
result = pXInputGetDSoundAudioDeviceGuids(XUSER_MAX_COUNT+1, &soundRender, &soundCapture);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetDSoundAudioDeviceGuids returned %lu\n", result);
}
static void test_get_batteryinformation(void)
@@ -270,17 +270,17 @@ static void test_get_batteryinformation(void)
ZeroMemory(&batteryInfo, sizeof(XINPUT_BATTERY_INFORMATION));
result = pXInputGetBatteryInformation(controllerNum, BATTERY_DEVTYPE_GAMEPAD, &batteryInfo);
- ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetBatteryInformation failed with (%d)\n", result);
+ ok(result == ERROR_SUCCESS || result == ERROR_DEVICE_NOT_CONNECTED, "XInputGetBatteryInformation returned %lu\n", result);
if (ERROR_DEVICE_NOT_CONNECTED == result)
{
ok(batteryInfo.BatteryLevel == BATTERY_TYPE_DISCONNECTED, "Failed to report device as being disconnected.\n");
- skip("Controller %d is not connected\n", controllerNum);
+ skip("Controller %lu is not connected\n", controllerNum);
}
}
result = pXInputGetBatteryInformation(XUSER_MAX_COUNT+1, BATTERY_DEVTYPE_GAMEPAD, &batteryInfo);
- ok(result == ERROR_BAD_ARGUMENTS, "XInputGetBatteryInformation returned (%d)\n", result);
+ ok(result == ERROR_BAD_ARGUMENTS, "XInputGetBatteryInformation returned %lu\n", result);
}
#define check_member_(file, line, val, exp, fmt, member) \
@@ -441,14 +441,15 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
USAGE usages[15];
NTSTATUS status;
USHORT count;
- DWORD i, res;
+ DWORD res;
BOOL ret;
+ int i;
res = pXInputGetCapabilities(index, 0, &xi_caps);
- ok(res == ERROR_SUCCESS, "XInputGetCapabilities %d returned %u\n", index, res);
+ ok(res == ERROR_SUCCESS, "XInputGetCapabilities %lu returned %lu\n", index, res);
res = pXInputGetState(index, &state);
- ok(res == ERROR_SUCCESS, "XInputGetState %d returned %u\n", index, res);
+ ok(res == ERROR_SUCCESS, "XInputGetState %lu returned %lu\n", index, res);
ok(hid_caps->UsagePage == HID_USAGE_PAGE_GENERIC, "unexpected usage page %04x\n", hid_caps->UsagePage);
ok(hid_caps->Usage == HID_USAGE_GENERIC_GAMEPAD, "unexpected usage %04x\n", hid_caps->Usage);
@@ -471,8 +472,8 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
length = hid_caps->NumberLinkCollectionNodes;
status = HidP_GetLinkCollectionNodes(collections, &length, preparsed);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes returned %#x\n", status);
- ok(length == ARRAY_SIZE(expect_collections), "got %d collections\n", length);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes returned %#lx\n", status);
+ ok(length == ARRAY_SIZE(expect_collections), "got %lu collections\n", length);
for (i = 0; i < min(length, ARRAY_SIZE(expect_collections)); ++i)
{
@@ -490,7 +491,7 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
count = hid_caps->NumberInputButtonCaps;
status = HidP_GetButtonCaps(HidP_Input, button_caps, &count, preparsed);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetButtonCaps returned %#x\n", status);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetButtonCaps returned %#lx\n", status);
ok(count == ARRAY_SIZE(expect_button_caps), "got %d button caps\n", count);
for (i = 0; i < ARRAY_SIZE(expect_button_caps); ++i)
@@ -541,7 +542,7 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
count = hid_caps->NumberInputValueCaps;
status = HidP_GetValueCaps(HidP_Input, value_caps, &count, preparsed);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetValueCaps returned %#x\n", status);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetValueCaps returned %#lx\n", status);
ok(count == ARRAY_SIZE(expect_value_caps), "got %d value caps\n", count);
for (i = 0; i < min(count, ARRAY_SIZE(expect_value_caps)); ++i)
@@ -562,12 +563,12 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
check_member(value_caps[i], expect_value_caps[i], "%d", HasNull);
check_member(value_caps[i], expect_value_caps[i], "%d", BitSize);
check_member(value_caps[i], expect_value_caps[i], "%d", ReportCount);
- check_member(value_caps[i], expect_value_caps[i], "%d", UnitsExp);
- check_member(value_caps[i], expect_value_caps[i], "%d", Units);
- check_member(value_caps[i], expect_value_caps[i], "%d", LogicalMin);
- check_member(value_caps[i], expect_value_caps[i], "%d", LogicalMax);
- check_member(value_caps[i], expect_value_caps[i], "%d", PhysicalMin);
- check_member(value_caps[i], expect_value_caps[i], "%d", PhysicalMax);
+ check_member(value_caps[i], expect_value_caps[i], "%#lx", UnitsExp);
+ check_member(value_caps[i], expect_value_caps[i], "%#lx", Units);
+ check_member(value_caps[i], expect_value_caps[i], "%+ld", LogicalMin);
+ check_member(value_caps[i], expect_value_caps[i], "%+ld", LogicalMax);
+ check_member(value_caps[i], expect_value_caps[i], "%+ld", PhysicalMin);
+ check_member(value_caps[i], expect_value_caps[i], "%+ld", PhysicalMax);
if (!value_caps[i].IsRange && !expect_value_caps[i].IsRange)
{
@@ -601,13 +602,13 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
}
status = HidP_InitializeReportForID(HidP_Input, 0, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_InitializeReportForID returned %#x\n", status);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_InitializeReportForID returned %#lx\n", status);
SetLastError(0xdeadbeef);
memset(buffer, 0, sizeof(buffer));
ret = HidD_GetInputReport(device, buffer, hid_caps->InputReportByteLength);
ok(!ret, "HidD_GetInputReport succeeded\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "HidD_GetInputReport returned error %u\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "HidD_GetInputReport returned error %lu\n", GetLastError());
if (!winetest_interactive) skip("skipping interactive tests\n");
/* ReadFile on Xbox One For Windows controller seems to never succeed */
@@ -615,15 +616,15 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
else
{
res = pXInputGetState(index, &last_state);
- ok(res == ERROR_SUCCESS, "XInputGetState returned %#x\n", res);
+ ok(res == ERROR_SUCCESS, "XInputGetState returned %#lx\n", res);
- trace("press A button on gamepad %d\n", index);
+ trace("press A button on gamepad %lu\n", index);
do
{
Sleep(5);
res = pXInputGetState(index, &state);
- ok(res == ERROR_SUCCESS, "XInputGetState returned %#x\n", res);
+ ok(res == ERROR_SUCCESS, "XInputGetState returned %#lx\n", res);
} while (res == ERROR_SUCCESS && state.dwPacketNumber == last_state.dwPacketNumber);
ok(state.Gamepad.wButtons & XINPUT_GAMEPAD_A, "unexpected button state %#x\n", state.Gamepad.wButtons);
@@ -634,24 +635,24 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
memset(buffer, 0, sizeof(buffer));
length = hid_caps->InputReportByteLength;
ret = ReadFile(device, buffer, hid_caps->InputReportByteLength, &length, NULL);
- ok(ret, "ReadFile failed, last error %u\n", GetLastError());
- ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %u\n", length);
+ ok(ret, "ReadFile failed, last error %lu\n", GetLastError());
+ ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %lu\n", length);
}
last_state = state;
length = ARRAY_SIZE(usages);
status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, 0, usages, &length, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#x\n", status);
- ok(length == 1, "got length %u\n", length);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#lx\n", status);
+ ok(length == 1, "got length %lu\n", length);
ok(usages[0] == 1, "got usages[0] %u\n", usages[0]);
- trace("release A on gamepad %d\n", index);
+ trace("release A on gamepad %lu\n", index);
do
{
Sleep(5);
res = pXInputGetState(index, &state);
- ok(res == ERROR_SUCCESS, "XInputGetState returned %#x\n", res);
+ ok(res == ERROR_SUCCESS, "XInputGetState returned %#lx\n", res);
} while (res == ERROR_SUCCESS && state.dwPacketNumber == last_state.dwPacketNumber);
ok(!state.Gamepad.wButtons, "unexpected button state %#x\n", state.Gamepad.wButtons);
@@ -662,17 +663,17 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
memset(buffer, 0, sizeof(buffer));
length = hid_caps->InputReportByteLength;
ret = ReadFile(device, buffer, hid_caps->InputReportByteLength, &length, NULL);
- ok(ret, "ReadFile failed, last error %u\n", GetLastError());
- ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %u\n", length);
+ ok(ret, "ReadFile failed, last error %lu\n", GetLastError());
+ ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %lu\n", length);
}
last_state = state;
length = ARRAY_SIZE(usages);
status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, 0, usages, &length, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#x\n", status);
- ok(length == 0, "got length %u\n", length);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsages returned %#lx\n", status);
+ ok(length == 0, "got length %lu\n", length);
- trace("press both LT and RT on gamepad %d\n", index);
+ trace("press both LT and RT on gamepad %lu\n", index);
do
{
@@ -680,7 +681,7 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
{
Sleep(5);
res = pXInputGetState(index, &state);
- ok(res == ERROR_SUCCESS, "XInputGetState returned %#x\n", res);
+ ok(res == ERROR_SUCCESS, "XInputGetState returned %#lx\n", res);
} while (res == ERROR_SUCCESS && state.dwPacketNumber == last_state.dwPacketNumber);
/* now read as many reports from the device to get a consistent final state */
@@ -690,35 +691,35 @@ static void check_hid_caps(DWORD index, HANDLE device, PHIDP_PREPARSED_DATA pre
memset(buffer, 0, sizeof(buffer));
length = hid_caps->InputReportByteLength;
ret = ReadFile(device, buffer, hid_caps->InputReportByteLength, &length, NULL);
- ok(ret, "ReadFile failed, last error %u\n", GetLastError());
- ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %u\n", length);
+ ok(ret, "ReadFile failed, last error %lu\n", GetLastError());
+ ok(length == hid_caps->InputReportByteLength, "ReadFile returned length %lu\n", length);
}
last_state = state;
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_X, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#x\n", status);
- ok(value == state.Gamepad.sThumbLX + 32768, "got LX value %d\n", value);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#lx\n", status);
+ ok(value == state.Gamepad.sThumbLX + 32768, "got LX value %lu\n", value);
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Y, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#x\n", status);
- ok(value == 32767 - state.Gamepad.sThumbLY, "got LY value %d\n", value);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#lx\n", status);
+ ok(value == 32767 - state.Gamepad.sThumbLY, "got LY value %lu\n", value);
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RX, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#x\n", status);
- ok(value == state.Gamepad.sThumbRX + 32768, "got LX value %d\n", value);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#lx\n", status);
+ ok(value == state.Gamepad.sThumbRX + 32768, "got LX value %lu\n", value);
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RY, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#x\n", status);
- ok(value == 32767 - state.Gamepad.sThumbRY, "got LY value %d\n", value);
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#lx\n", status);
+ ok(value == 32767 - state.Gamepad.sThumbRY, "got LY value %lu\n", value);
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_Z, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#x\n", status);
- ok(value == 32768 + (state.Gamepad.bLeftTrigger - state.Gamepad.bRightTrigger) * 128, "got Z value %d (RT %d, LT %d)\n",
+ ok(status == HIDP_STATUS_SUCCESS, "HidP_GetUsageValue returned %#lx\n", status);
+ ok(value == 32768 + (state.Gamepad.bLeftTrigger - state.Gamepad.bRightTrigger) * 128, "got Z value %lu (RT %d, LT %d)\n",
value, state.Gamepad.bRightTrigger, state.Gamepad.bLeftTrigger);
value = 0;
status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, 0, HID_USAGE_GENERIC_RZ, &value, preparsed, buffer, hid_caps->InputReportByteLength);
- ok(status == HIDP_STATUS_USAGE_NOT_FOUND, "HidP_GetUsageValue returned %#x\n", status);
+ ok(status == HIDP_STATUS_USAGE_NOT_FOUND, "HidP_GetUsageValue returned %#lx\n", status);
} while (ret && (state.Gamepad.bRightTrigger != 255 || state.Gamepad.bLeftTrigger != 255));
}
}
@@ -765,7 +766,7 @@ static void test_hid_reports(void)
HidD_GetHidGuid(&hid);
set = SetupDiGetClassDevsW(&hid, NULL, NULL, DIGCF_DEVICEINTERFACE);
- ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %u\n", GetLastError());
+ ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsW failed, error %lu\n", GetLastError());
while (SetupDiEnumDeviceInterfaces(set, NULL, &hid, i++, &iface))
{
--
2.34.1
Jan. 31, 2022
[PATCH 1/5] windows.gaming.input/tests: Fix printf warnings with long types.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/windows.gaming.input/tests/Makefile.in | 1 -
dlls/windows.gaming.input/tests/input.c | 80 ++++++++++-----------
2 files changed, 40 insertions(+), 41 deletions(-)
diff --git a/dlls/windows.gaming.input/tests/Makefile.in b/dlls/windows.gaming.input/tests/Makefile.in
index 19fb708d0d2..88e1c05fbcf 100644
--- a/dlls/windows.gaming.input/tests/Makefile.in
+++ b/dlls/windows.gaming.input/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = windows.gaming.input.dll
IMPORTS = combase uuid
diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c
index 6e863def54d..5f2244d8666 100644
--- a/dlls/windows.gaming.input/tests/input.c
+++ b/dlls/windows.gaming.input/tests/input.c
@@ -113,13 +113,13 @@ static void test_Gamepad(void)
gamepad_event_handler.IEventHandler_Gamepad_iface.lpVtbl = &gamepad_event_handler_vtbl;
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(gamepad_name, wcslen(gamepad_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
+ ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#lx\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(gamepad_name));
@@ -127,78 +127,78 @@ static void test_Gamepad(void)
}
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IGamepadStatics, (void **)&gamepad_statics);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGamepadStatics failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGamepadStatics failed, hr %#lx\n", hr);
hr = IGamepadStatics_QueryInterface(gamepad_statics, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IGamepadStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IGamepadStatics_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IGamepadStatics_QueryInterface(gamepad_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IGamepadStatics_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IGamepadStatics_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
hr = IGamepadStatics_get_Gamepads(gamepad_statics, &gamepads);
- ok(hr == S_OK, "IGamepadStatics_get_Gamepads failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_get_Gamepads failed, hr %#lx\n", hr);
hr = IVectorView_Gamepad_QueryInterface(gamepads, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IVectorView_Gamepad_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_Gamepad_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_inspectable != inspectable, "IVectorView_Gamepad_QueryInterface returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IVectorView_Gamepad_QueryInterface(gamepads, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IVectorView_Gamepad_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_Gamepad_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_agile_object != agile_object, "IVectorView_Gamepad_QueryInterface IID_IAgileObject returned agile_object\n");
IAgileObject_Release(tmp_agile_object);
size = 0xdeadbeef;
hr = IVectorView_Gamepad_get_Size(gamepads, &size);
- ok(hr == S_OK, "IVectorView_Gamepad_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_Gamepad_get_Size failed, hr %#lx\n", hr);
ok(size != 0xdeadbeef, "IVectorView_Gamepad_get_Size returned %u\n", size);
gamepad = (IGamepad *)0xdeadbeef;
hr = IVectorView_Gamepad_GetAt(gamepads, size, &gamepad);
- ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetAt failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetAt failed, hr %#lx\n", hr);
ok(gamepad == NULL, "IVectorView_Gamepad_GetAt returned %p\n", gamepad);
hr = IVectorView_Gamepad_GetMany(gamepads, size, 1, &gamepad, &size);
- ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetMany failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetMany failed, hr %#lx\n", hr);
ok(size == 0, "IVectorView_Gamepad_GetMany returned count %u\n", size);
size = 0xdeadbeef;
found = TRUE;
gamepad = (IGamepad *)0xdeadbeef;
hr = IVectorView_Gamepad_IndexOf(gamepads, gamepad, &size, &found);
- ok(hr == S_OK, "IVectorView_Gamepad_IndexOf failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_Gamepad_IndexOf failed, hr %#lx\n", hr);
ok(size == 0 && found == FALSE, "IVectorView_Gamepad_IndexOf returned size %d, found %d\n", size, found);
IVectorView_Gamepad_Release(gamepads);
token.value = 0xdeadbeef;
hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token);
- ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#lx\n", hr);
ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadAdded returned token %#I64x\n", token.value);
hr = IGamepadStatics_remove_GamepadAdded(gamepad_statics, token);
- ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#lx\n", hr);
token.value = 0xdeadbeef;
hr = IGamepadStatics_add_GamepadRemoved(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token);
- ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#lx\n", hr);
ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadRemoved returned token %#I64x\n", token.value);
hr = IGamepadStatics_remove_GamepadRemoved(gamepad_statics, token);
- ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#lx\n", hr);
hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, NULL, &token);
- ok(hr == E_INVALIDARG, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
+ ok(hr == E_INVALIDARG, "IGamepadStatics_add_GamepadAdded failed, hr %#lx\n", hr);
IGamepadStatics_Release(gamepad_statics);
@@ -290,13 +290,13 @@ static void test_RawGameController(void)
controller_event_handler.IEventHandler_RawGameController_iface.lpVtbl = &controller_event_handler_vtbl;
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK || hr == S_FALSE, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK || hr == S_FALSE, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(controller_name, wcslen(controller_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
+ ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#lx\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(controller_name));
@@ -304,78 +304,78 @@ static void test_RawGameController(void)
}
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IRawGameControllerStatics, (void **)&controller_statics);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IRawGameControllerStatics failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IRawGameControllerStatics failed, hr %#lx\n", hr);
hr = IRawGameControllerStatics_QueryInterface(controller_statics, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IRawGameControllerStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IRawGameControllerStatics_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IRawGameControllerStatics_QueryInterface(controller_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IRawGameControllerStatics_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IRawGameControllerStatics_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
hr = IRawGameControllerStatics_get_RawGameControllers(controller_statics, &controllers);
- ok(hr == S_OK, "IRawGameControllerStatics_get_RawGameControllers failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_get_RawGameControllers failed, hr %#lx\n", hr);
hr = IVectorView_RawGameController_QueryInterface(controllers, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IVectorView_RawGameController_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_RawGameController_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_inspectable != inspectable, "IVectorView_RawGameController_QueryInterface returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IVectorView_RawGameController_QueryInterface(controllers, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IVectorView_RawGameController_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_RawGameController_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_agile_object != agile_object, "IVectorView_RawGameController_QueryInterface IID_IAgileObject returned agile_object\n");
IAgileObject_Release(tmp_agile_object);
size = 0xdeadbeef;
hr = IVectorView_RawGameController_get_Size(controllers, &size);
- ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#lx\n", hr);
ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size);
hr = IVectorView_RawGameController_GetMany(controllers, size, 1, &controller, &size);
- ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetMany failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetMany failed, hr %#lx\n", hr);
ok(size == 0, "IVectorView_RawGameController_GetMany returned count %u\n", size);
controller = (IRawGameController *)0xdeadbeef;
hr = IVectorView_RawGameController_GetAt(controllers, size, &controller);
- ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#lx\n", hr);
ok(controller == NULL, "IVectorView_RawGameController_GetAt returned %p\n", controller);
size = 0xdeadbeef;
found = TRUE;
controller = (IRawGameController *)0xdeadbeef;
hr = IVectorView_RawGameController_IndexOf(controllers, controller, &size, &found);
- ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#lx\n", hr);
ok(size == 0 && found == FALSE, "IVectorView_RawGameController_IndexOf returned size %d, found %d\n", size, found);
IVectorView_RawGameController_Release(controllers);
token.value = 0xdeadbeef;
hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token);
- ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#lx\n", hr);
ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerAdded returned token %#I64x\n", token.value);
hr = IRawGameControllerStatics_remove_RawGameControllerAdded(controller_statics, token);
- ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#lx\n", hr);
token.value = 0xdeadbeef;
hr = IRawGameControllerStatics_add_RawGameControllerRemoved(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token);
- ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#lx\n", hr);
ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerRemoved returned token %#I64x\n", token.value);
hr = IRawGameControllerStatics_remove_RawGameControllerRemoved(controller_statics, token);
- ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#lx\n", hr);
hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, NULL, &token);
- ok(hr == E_INVALIDARG, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
+ ok(hr == E_INVALIDARG, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#lx\n", hr);
IRawGameControllerStatics_Release(controller_statics);
--
2.34.1
Jan. 31, 2022