Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 4 participants
- 84544 discussions
[PATCH v2 2/2] iphlpapi: Don't request redundant static data in get_extended_tcp_table().
by Huw Davies March 23, 2022
by Huw Davies March 23, 2022
March 23, 2022
From: Paul Gofman <pgofman(a)codeweavers.com>
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/iphlpapi/iphlpapi_main.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 041e712f44f..afc400d26c1 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -3082,6 +3082,19 @@ static int tcp6_row_owner_cmp( const void *a, const void *b )
return RtlUshortByteSwap( rowA->dwRemotePort ) - RtlUshortByteSwap( rowB->dwRemotePort );
}
+static BOOL tcp_table_needs_pids( ULONG table_class )
+{
+ switch (table_class)
+ {
+ case TCP_TABLE_BASIC_LISTENER:
+ case TCP_TABLE_BASIC_CONNECTIONS:
+ case TCP_TABLE_BASIC_ALL:
+ return FALSE;
+
+ }
+ return TRUE;
+}
+
/*************************************************************************************
* get_extended_tcp_table
*
@@ -3093,13 +3106,19 @@ static DWORD get_extended_tcp_table( void *table, DWORD *size, BOOL sort, ULONG
DWORD err, count, needed, i, num = 0, row_size = 0;
struct nsi_tcp_conn_key *key;
struct nsi_tcp_conn_dynamic *dyn;
- struct nsi_tcp_conn_static *stat;
+ struct nsi_tcp_conn_static *stat = NULL;
if (!size) return ERROR_INVALID_PARAMETER;
- err = NsiAllocateAndGetTable( 1, &NPI_MS_TCP_MODULEID, tcp_table_id( table_class ), (void **)&key, sizeof(*key),
- NULL, 0, (void **)&dyn, sizeof(*dyn),
- (void **)&stat, sizeof(*stat), &count, 0 );
+ if (tcp_table_needs_pids( table_class ))
+ err = NsiAllocateAndGetTable( 1, &NPI_MS_TCP_MODULEID, tcp_table_id( table_class ), (void **)&key, sizeof(*key),
+ NULL, 0, (void **)&dyn, sizeof(*dyn),
+ (void **)&stat, sizeof(*stat), &count, 0 );
+ else /* Don't retrieve the static data if not required as this is expensive to compute */
+ err = NsiAllocateAndGetTable( 1, &NPI_MS_TCP_MODULEID, tcp_table_id( table_class ), (void **)&key, sizeof(*key),
+ NULL, 0, (void **)&dyn, sizeof(*dyn),
+ NULL, 0, &count, 0 );
+
if (err) return err;
for (i = 0; i < count; i++)
--
2.23.0
1
0
[PATCH v2 1/2] nsiproxy: Avoid redundant pid mapping in tcp_conns_enumerate_all().
by Huw Davies March 23, 2022
by Huw Davies March 23, 2022
March 23, 2022
From: Paul Gofman <pgofman(a)codeweavers.com>
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/nsiproxy.sys/tcp.c | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c
index 0cd81ae86e5..491ac797100 100644
--- a/dlls/nsiproxy.sys/tcp.c
+++ b/dlls/nsiproxy.sys/tcp.c
@@ -540,7 +540,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
memset( &key, 0, sizeof(key) );
memset( &dyn, 0, sizeof(dyn) );
memset( &stat, 0, sizeof(stat) );
- pid_map = get_pid_map( &pid_map_size );
+ if (static_data) pid_map = get_pid_map( &pid_map_size );
/* skip header line */
ptr = fgets( buf, sizeof(buf), fp );
@@ -558,15 +558,17 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port );
key.remote.Ipv4.sin_port = htons( key.remote.Ipv4.sin_port );
- stat.pid = find_owning_pid( pid_map, pid_map_size, inode );
- stat.create_time = 0; /* FIXME */
- stat.mod_info = 0; /* FIXME */
-
if (num < *count)
{
if (key_data) *key_data++ = key;
if (dynamic_data) *dynamic_data++ = dyn;
- if (static_data) *static_data++ = stat;
+ if (static_data)
+ {
+ stat.pid = find_owning_pid( pid_map, pid_map_size, inode );
+ stat.create_time = 0; /* FIXME */
+ stat.mod_info = 0; /* FIXME */
+ *static_data++ = stat;
+ }
}
num++;
}
@@ -601,16 +603,17 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
addr_scopes_size );
key.remote.Ipv6.sin6_scope_id = find_ipv6_addr_scope( &key.remote.Ipv6.sin6_addr, addr_scopes,
addr_scopes_size );
-
- stat.pid = find_owning_pid( pid_map, pid_map_size, inode );
- stat.create_time = 0; /* FIXME */
- stat.mod_info = 0; /* FIXME */
-
if (num < *count)
{
if (key_data) *key_data++ = key;
if (dynamic_data) *dynamic_data++ = dyn;
- if (static_data) *static_data++ = stat;
+ if (static_data)
+ {
+ stat.pid = find_owning_pid( pid_map, pid_map_size, inode );
+ stat.create_time = 0; /* FIXME */
+ stat.mod_info = 0; /* FIXME */
+ *static_data++ = stat;
+ }
}
num++;
}
@@ -649,7 +652,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
if (len <= sizeof(struct xinpgen)) goto err;
addr_scopes = get_ipv6_addr_scope_table( &addr_scopes_size );
- pid_map = get_pid_map( &pid_map_size );
+ if (static_data) pid_map = get_pid_map( &pid_map_size );
orig_xig = (struct xinpgen *)buf;
xig = orig_xig;
@@ -708,15 +711,17 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *
addr_scopes_size );
}
- stat.pid = find_owning_pid( pid_map, pid_map_size, (UINT_PTR)sock->so_pcb );
- stat.create_time = 0; /* FIXME */
- stat.mod_info = 0; /* FIXME */
-
if (num < *count)
{
if (key_data) *key_data++ = key;
if (dynamic_data) *dynamic_data++ = dyn;
- if (static_data) *static_data++ = stat;
+ if (static_data)
+ {
+ stat.pid = find_owning_pid( pid_map, pid_map_size, (UINT_PTR)sock->so_pcb );
+ stat.create_time = 0; /* FIXME */
+ stat.mod_info = 0; /* FIXME */
+ *static_data++ = stat;
+ }
}
num++;
}
--
2.23.0
1
0
March 23, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/sync.c | 291 ++++++++++++++++++++++++-----------------------
1 file changed, 146 insertions(+), 145 deletions(-)
diff --git a/dlls/ntdll/tests/sync.c b/dlls/ntdll/tests/sync.c
index f930767a8b0..12f5898a391 100644
--- a/dlls/ntdll/tests/sync.c
+++ b/dlls/ntdll/tests/sync.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
@@ -74,75 +75,75 @@ static void test_event(void)
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtCreateEvent(&event, GENERIC_ALL, &attr, 2, 0);
- ok( status == STATUS_INVALID_PARAMETER, "NtCreateEvent failed %08x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "NtCreateEvent failed %08lx\n", status );
status = pNtCreateEvent(&event, GENERIC_ALL, &attr, NotificationEvent, 0);
- ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08lx\n", status );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryEvent(event, EventBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08lx\n", status );
ok( info.EventType == NotificationEvent && info.EventState == 0,
- "NtQueryEvent failed, expected 0 0, got %d %d\n", info.EventType, info.EventState );
+ "NtQueryEvent failed, expected 0 0, got %d %ld\n", info.EventType, info.EventState );
pNtClose(event);
status = pNtCreateEvent(&event, GENERIC_ALL, &attr, SynchronizationEvent, 0);
- ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtCreateEvent failed %08lx\n", status );
status = pNtPulseEvent(event, &prev_state);
- ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08x\n", status );
- ok( !prev_state, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08lx\n", status );
+ ok( !prev_state, "prev_state = %lx\n", prev_state );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryEvent(event, EventBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08lx\n", status );
ok( info.EventType == SynchronizationEvent && info.EventState == 0,
- "NtQueryEvent failed, expected 1 0, got %d %d\n", info.EventType, info.EventState );
+ "NtQueryEvent failed, expected 1 0, got %d %ld\n", info.EventType, info.EventState );
status = pNtOpenEvent(&event2, GENERIC_ALL, &attr);
- ok( status == STATUS_SUCCESS, "NtOpenEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtOpenEvent failed %08lx\n", status );
pNtClose(event);
event = event2;
memset(&info, 0xcc, sizeof(info));
status = pNtQueryEvent(event, EventBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08lx\n", status );
ok( info.EventType == SynchronizationEvent && info.EventState == 0,
- "NtQueryEvent failed, expected 1 0, got %d %d\n", info.EventType, info.EventState );
+ "NtQueryEvent failed, expected 1 0, got %d %ld\n", info.EventType, info.EventState );
status = pNtSetEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status );
- ok( !prev_state, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08lx\n", status );
+ ok( !prev_state, "prev_state = %lx\n", prev_state );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryEvent(event, EventBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08x\n", status );
+ ok( status == STATUS_SUCCESS, "NtQueryEvent failed %08lx\n", status );
ok( info.EventType == SynchronizationEvent && info.EventState == 1,
- "NtQueryEvent failed, expected 1 1, got %d %d\n", info.EventType, info.EventState );
+ "NtQueryEvent failed, expected 1 1, got %d %ld\n", info.EventType, info.EventState );
status = pNtSetEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status );
- ok( prev_state == 1, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08lx\n", status );
+ ok( prev_state == 1, "prev_state = %lx\n", prev_state );
status = pNtResetEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status );
- ok( prev_state == 1, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08lx\n", status );
+ ok( prev_state == 1, "prev_state = %lx\n", prev_state );
status = pNtResetEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status );
- ok( !prev_state, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08lx\n", status );
+ ok( !prev_state, "prev_state = %lx\n", prev_state );
status = pNtPulseEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08x\n", status );
- ok( !prev_state, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08lx\n", status );
+ ok( !prev_state, "prev_state = %lx\n", prev_state );
status = pNtSetEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08x\n", status );
- ok( !prev_state, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtSetEvent failed: %08lx\n", status );
+ ok( !prev_state, "prev_state = %lx\n", prev_state );
status = pNtPulseEvent( event, &prev_state );
- ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08x\n", status );
- ok( prev_state == 1, "prev_state = %x\n", prev_state );
+ ok( status == STATUS_SUCCESS, "NtPulseEvent failed %08lx\n", status );
+ ok( prev_state == 1, "prev_state = %lx\n", prev_state );
pNtClose(event);
}
@@ -167,7 +168,7 @@ static DWORD WINAPI keyed_event_thread( void *arg )
RtlInitUnicodeString( &str, keyed_nameW );
status = pNtOpenKeyedEvent( &handle, KEYEDEVENT_ALL_ACCESS, &attr );
- ok( !status, "NtOpenKeyedEvent failed %x\n", status );
+ ok( !status, "NtOpenKeyedEvent failed %lx\n", status );
for (i = 0; i < 20; i++)
{
@@ -175,18 +176,18 @@ static DWORD WINAPI keyed_event_thread( void *arg )
status = pNtWaitForKeyedEvent( handle, (void *)(i * 2), 0, NULL );
else
status = pNtReleaseKeyedEvent( handle, (void *)(i * 2), 0, NULL );
- ok( status == STATUS_SUCCESS, "%li: failed %x\n", i, status );
+ ok( status == STATUS_SUCCESS, "%Ii: failed %lx\n", i, status );
Sleep( 20 - i );
}
status = pNtReleaseKeyedEvent( handle, (void *)0x1234, 0, NULL );
- ok( status == STATUS_SUCCESS, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_SUCCESS, "NtReleaseKeyedEvent %lx\n", status );
timeout.QuadPart = -10000;
status = pNtWaitForKeyedEvent( handle, (void *)0x5678, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)0x9abc, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
NtClose( handle );
return 0;
@@ -216,43 +217,43 @@ static void test_keyed_events(void)
RtlInitUnicodeString( &str, keyed_nameW );
status = pNtCreateKeyedEvent( &handle, KEYEDEVENT_ALL_ACCESS | SYNCHRONIZE, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = WaitForSingleObject( handle, 1000 );
- ok( status == 0, "WaitForSingleObject %x\n", status );
+ ok( status == 0, "WaitForSingleObject %lx\n", status );
timeout.QuadPart = -100000;
status = pNtWaitForKeyedEvent( handle, (void *)255, 0, &timeout );
- ok( status == STATUS_INVALID_PARAMETER_1, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER_1, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)255, 0, &timeout );
- ok( status == STATUS_INVALID_PARAMETER_1, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER_1, "NtReleaseKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)254, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)254, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( handle, NULL, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, NULL, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( NULL, (void *)8, 0, &timeout );
ok( status == STATUS_TIMEOUT || broken(status == STATUS_INVALID_HANDLE), /* XP/2003 */
- "NtWaitForKeyedEvent %x\n", status );
+ "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( NULL, (void *)8, 0, &timeout );
ok( status == STATUS_TIMEOUT || broken(status == STATUS_INVALID_HANDLE), /* XP/2003 */
- "NtReleaseKeyedEvent %x\n", status );
+ "NtReleaseKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( (HANDLE)0xdeadbeef, (void *)9, 0, &timeout );
- ok( status == STATUS_INVALID_PARAMETER_1, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER_1, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( (HANDLE)0xdeadbeef, (void *)9, 0, &timeout );
- ok( status == STATUS_INVALID_PARAMETER_1, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER_1, "NtReleaseKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( (HANDLE)0xdeadbeef, (void *)8, 0, &timeout );
- ok( status == STATUS_INVALID_HANDLE, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_HANDLE, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( (HANDLE)0xdeadbeef, (void *)8, 0, &timeout );
- ok( status == STATUS_INVALID_HANDLE, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_INVALID_HANDLE, "NtReleaseKeyedEvent %lx\n", status );
thread = CreateThread( NULL, 0, keyed_event_thread, 0, 0, NULL );
for (i = 0; i < 20; i++)
@@ -261,15 +262,15 @@ static void test_keyed_events(void)
status = pNtReleaseKeyedEvent( handle, (void *)(i * 2), 0, NULL );
else
status = pNtWaitForKeyedEvent( handle, (void *)(i * 2), 0, NULL );
- ok( status == STATUS_SUCCESS, "%li: failed %x\n", i, status );
+ ok( status == STATUS_SUCCESS, "%Ii: failed %lx\n", i, status );
Sleep( i );
}
status = pNtWaitForKeyedEvent( handle, (void *)0x1234, 0, &timeout );
- ok( status == STATUS_SUCCESS, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_SUCCESS, "NtWaitForKeyedEvent %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)0x5678, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)0x9abc, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
ok( WaitForSingleObject( thread, 30000 ) == 0, "wait failed\n" );
@@ -278,65 +279,65 @@ static void test_keyed_events(void)
/* test access rights */
status = pNtCreateKeyedEvent( &handle, KEYEDEVENT_WAIT, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_ACCESS_DENIED, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_ACCESS_DENIED, "NtReleaseKeyedEvent %lx\n", status );
NtClose( handle );
status = pNtCreateKeyedEvent( &handle, KEYEDEVENT_WAKE, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_ACCESS_DENIED, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_ACCESS_DENIED, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
NtClose( handle );
status = pNtCreateKeyedEvent( &handle, KEYEDEVENT_ALL_ACCESS, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = WaitForSingleObject( handle, 1000 );
ok( status == WAIT_FAILED && GetLastError() == ERROR_ACCESS_DENIED,
- "WaitForSingleObject %x err %u\n", status, GetLastError() );
+ "WaitForSingleObject %lx err %lu\n", status, GetLastError() );
status = pNtWaitForKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
NtClose( handle );
/* GENERIC_READ gives wait access */
status = pNtCreateKeyedEvent( &handle, GENERIC_READ, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_ACCESS_DENIED, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_ACCESS_DENIED, "NtReleaseKeyedEvent %lx\n", status );
NtClose( handle );
/* GENERIC_WRITE gives wake access */
status = pNtCreateKeyedEvent( &handle, GENERIC_WRITE, &attr, 0 );
- ok( !status, "NtCreateKeyedEvent failed %x\n", status );
+ ok( !status, "NtCreateKeyedEvent failed %lx\n", status );
status = pNtWaitForKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_ACCESS_DENIED, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_ACCESS_DENIED, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( handle, (void *)8, 0, &timeout );
- ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_TIMEOUT, "NtReleaseKeyedEvent %lx\n", status );
/* it's not an event */
status = pNtPulseEvent( handle, NULL );
- ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtPulseEvent %x\n", status );
+ ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtPulseEvent %lx\n", status );
status = pNtCreateEvent( &event, GENERIC_ALL, &attr, NotificationEvent, FALSE );
ok( status == STATUS_OBJECT_NAME_COLLISION || status == STATUS_OBJECT_TYPE_MISMATCH /* 7+ */,
- "CreateEvent %x\n", status );
+ "CreateEvent %lx\n", status );
NtClose( handle );
status = pNtCreateEvent( &event, GENERIC_ALL, &attr, NotificationEvent, FALSE );
- ok( status == 0, "CreateEvent %x\n", status );
+ ok( status == 0, "CreateEvent %lx\n", status );
status = pNtWaitForKeyedEvent( event, (void *)8, 0, &timeout );
- ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtWaitForKeyedEvent %x\n", status );
+ ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtWaitForKeyedEvent %lx\n", status );
status = pNtReleaseKeyedEvent( event, (void *)8, 0, &timeout );
- ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtReleaseKeyedEvent %x\n", status );
+ ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtReleaseKeyedEvent %lx\n", status );
NtClose( event );
}
@@ -349,12 +350,12 @@ static DWORD WINAPI mutant_thread( void *arg )
mutant = arg;
ret = WaitForSingleObject( mutant, 1000 );
- ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08x\n", ret );
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08lx\n", ret );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == 0, "expected 0, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == 0, "expected 0, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == TRUE, "expected TRUE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == FALSE, "expected FALSE, got %d\n", info.AbandonedState );
/* abandon mutant */
@@ -377,76 +378,76 @@ static void test_mutant(void)
pRtlInitUnicodeString(&str, L"\\BaseNamedObjects\\test_mutant");
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtCreateMutant(&mutant, GENERIC_ALL, &attr, TRUE);
- ok( status == STATUS_SUCCESS, "Failed to create Mutant(%08x)\n", status );
+ ok( status == STATUS_SUCCESS, "Failed to create Mutant(%08lx)\n", status );
/* bogus */
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, 0, NULL);
ok( status == STATUS_INFO_LENGTH_MISMATCH,
- "Failed to NtQueryMutant, expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
+ "Failed to NtQueryMutant, expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status );
status = pNtQueryMutant(mutant, 0x42, &info, sizeof(info), NULL);
ok( status == STATUS_INVALID_INFO_CLASS || broken(status == STATUS_NOT_IMPLEMENTED), /* 32-bit on Vista/2k8 */
- "Failed to NtQueryMutant, expected STATUS_INVALID_INFO_CLASS, got %08x\n", status );
+ "Failed to NtQueryMutant, expected STATUS_INVALID_INFO_CLASS, got %08lx\n", status );
status = pNtQueryMutant((HANDLE)0xdeadbeef, MutantBasicInformation, &info, sizeof(info), NULL);
ok( status == STATUS_INVALID_HANDLE,
- "Failed to NtQueryMutant, expected STATUS_INVALID_HANDLE, got %08x\n", status );
+ "Failed to NtQueryMutant, expected STATUS_INVALID_HANDLE, got %08lx\n", status );
/* new */
len = -1;
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), &len);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == 0, "expected 0, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == 0, "expected 0, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == TRUE, "expected TRUE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == FALSE, "expected FALSE, got %d\n", info.AbandonedState );
- ok( len == sizeof(info), "got %u\n", len );
+ ok( len == sizeof(info), "got %lu\n", len );
ret = WaitForSingleObject( mutant, 1000 );
- ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08x\n", ret );
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08lx\n", ret );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == -1, "expected -1, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == -1, "expected -1, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == TRUE, "expected TRUE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == FALSE, "expected FALSE, got %d\n", info.AbandonedState );
prev = 0xdeadbeef;
status = pNtReleaseMutant(mutant, &prev);
- ok( status == STATUS_SUCCESS, "NtReleaseMutant failed %08x\n", status );
- ok( prev == -1, "NtReleaseMutant failed, expected -1, got %d\n", prev );
+ ok( status == STATUS_SUCCESS, "NtReleaseMutant failed %08lx\n", status );
+ ok( prev == -1, "NtReleaseMutant failed, expected -1, got %ld\n", prev );
prev = 0xdeadbeef;
status = pNtReleaseMutant(mutant, &prev);
- ok( status == STATUS_SUCCESS, "NtReleaseMutant failed %08x\n", status );
- ok( prev == 0, "NtReleaseMutant failed, expected 0, got %d\n", prev );
+ ok( status == STATUS_SUCCESS, "NtReleaseMutant failed %08lx\n", status );
+ ok( prev == 0, "NtReleaseMutant failed, expected 0, got %ld\n", prev );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == 1, "expected 1, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == 1, "expected 1, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == FALSE, "expected FALSE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == FALSE, "expected FALSE, got %d\n", info.AbandonedState );
/* abandoned */
thread = CreateThread( NULL, 0, mutant_thread, mutant, 0, NULL );
ret = WaitForSingleObject( thread, 1000 );
- ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08x\n", ret );
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08lx\n", ret );
CloseHandle( thread );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == 1, "expected 0, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == 1, "expected 0, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == FALSE, "expected FALSE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == TRUE, "expected TRUE, got %d\n", info.AbandonedState );
ret = WaitForSingleObject( mutant, 1000 );
- ok( ret == WAIT_ABANDONED_0, "WaitForSingleObject failed %08x\n", ret );
+ ok( ret == WAIT_ABANDONED_0, "WaitForSingleObject failed %08lx\n", ret );
memset(&info, 0xcc, sizeof(info));
status = pNtQueryMutant(mutant, MutantBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08x\n", status );
- ok( info.CurrentCount == 0, "expected 0, got %d\n", info.CurrentCount );
+ ok( status == STATUS_SUCCESS, "NtQueryMutant failed %08lx\n", status );
+ ok( info.CurrentCount == 0, "expected 0, got %ld\n", info.CurrentCount );
ok( info.OwnedByCaller == TRUE, "expected TRUE, got %d\n", info.OwnedByCaller );
ok( info.AbandonedState == FALSE, "expected FALSE, got %d\n", info.AbandonedState );
@@ -468,63 +469,63 @@ static void test_semaphore(void)
InitializeObjectAttributes(&attr, &str, 0, 0, NULL);
status = pNtCreateSemaphore(&semaphore, GENERIC_ALL, &attr, 2, 1);
- ok( status == STATUS_INVALID_PARAMETER, "Failed to create Semaphore(%08x)\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "Failed to create Semaphore(%08lx)\n", status );
status = pNtCreateSemaphore(&semaphore, GENERIC_ALL, &attr, 1, 2);
- ok( status == STATUS_SUCCESS, "Failed to create Semaphore(%08x)\n", status );
+ ok( status == STATUS_SUCCESS, "Failed to create Semaphore(%08lx)\n", status );
/* bogus */
status = pNtQuerySemaphore(semaphore, SemaphoreBasicInformation, &info, 0, NULL);
ok( status == STATUS_INFO_LENGTH_MISMATCH,
- "Failed to NtQuerySemaphore, expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
+ "Failed to NtQuerySemaphore, expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status );
status = pNtQuerySemaphore(semaphore, 0x42, &info, sizeof(info), NULL);
ok( status == STATUS_INVALID_INFO_CLASS,
- "Failed to NtQuerySemaphore, expected STATUS_INVALID_INFO_CLASS, got %08x\n", status );
+ "Failed to NtQuerySemaphore, expected STATUS_INVALID_INFO_CLASS, got %08lx\n", status );
status = pNtQuerySemaphore((HANDLE)0xdeadbeef, SemaphoreBasicInformation, &info, sizeof(info), NULL);
ok( status == STATUS_INVALID_HANDLE,
- "Failed to NtQuerySemaphore, expected STATUS_INVALID_HANDLE, got %08x\n", status );
+ "Failed to NtQuerySemaphore, expected STATUS_INVALID_HANDLE, got %08lx\n", status );
len = -1;
memset(&info, 0xcc, sizeof(info));
status = pNtQuerySemaphore(semaphore, SemaphoreBasicInformation, &info, sizeof(info), &len);
- ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08x\n", status );
- ok( info.CurrentCount == 1, "expected 1, got %d\n", info.CurrentCount );
- ok( info.MaximumCount == 2, "expected 2, got %d\n", info.MaximumCount );
- ok( len == sizeof(info), "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08lx\n", status );
+ ok( info.CurrentCount == 1, "expected 1, got %ld\n", info.CurrentCount );
+ ok( info.MaximumCount == 2, "expected 2, got %ld\n", info.MaximumCount );
+ ok( len == sizeof(info), "got %lu\n", len );
ret = WaitForSingleObject( semaphore, 1000 );
- ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08x\n", ret );
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject failed %08lx\n", ret );
memset(&info, 0xcc, sizeof(info));
status = pNtQuerySemaphore(semaphore, SemaphoreBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08x\n", status );
- ok( info.CurrentCount == 0, "expected 0, got %d\n", info.CurrentCount );
- ok( info.MaximumCount == 2, "expected 2, got %d\n", info.MaximumCount );
+ ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08lx\n", status );
+ ok( info.CurrentCount == 0, "expected 0, got %ld\n", info.CurrentCount );
+ ok( info.MaximumCount == 2, "expected 2, got %ld\n", info.MaximumCount );
prev = 0xdeadbeef;
status = pNtReleaseSemaphore(semaphore, 3, &prev);
- ok( status == STATUS_SEMAPHORE_LIMIT_EXCEEDED, "NtReleaseSemaphore failed %08x\n", status );
- ok( prev == 0xdeadbeef, "NtReleaseSemaphore failed, expected 0xdeadbeef, got %d\n", prev );
+ ok( status == STATUS_SEMAPHORE_LIMIT_EXCEEDED, "NtReleaseSemaphore failed %08lx\n", status );
+ ok( prev == 0xdeadbeef, "NtReleaseSemaphore failed, expected 0xdeadbeef, got %ld\n", prev );
prev = 0xdeadbeef;
status = pNtReleaseSemaphore(semaphore, 1, &prev);
- ok( status == STATUS_SUCCESS, "NtReleaseSemaphore failed %08x\n", status );
- ok( prev == 0, "NtReleaseSemaphore failed, expected 0, got %d\n", prev );
+ ok( status == STATUS_SUCCESS, "NtReleaseSemaphore failed %08lx\n", status );
+ ok( prev == 0, "NtReleaseSemaphore failed, expected 0, got %ld\n", prev );
prev = 0xdeadbeef;
status = pNtReleaseSemaphore(semaphore, 1, &prev);
- ok( status == STATUS_SUCCESS, "NtReleaseSemaphore failed %08x\n", status );
- ok( prev == 1, "NtReleaseSemaphore failed, expected 1, got %d\n", prev );
+ ok( status == STATUS_SUCCESS, "NtReleaseSemaphore failed %08lx\n", status );
+ ok( prev == 1, "NtReleaseSemaphore failed, expected 1, got %ld\n", prev );
prev = 0xdeadbeef;
status = pNtReleaseSemaphore(semaphore, 1, &prev);
- ok( status == STATUS_SEMAPHORE_LIMIT_EXCEEDED, "NtReleaseSemaphore failed %08x\n", status );
- ok( prev == 0xdeadbeef, "NtReleaseSemaphore failed, expected 0xdeadbeef, got %d\n", prev );
+ ok( status == STATUS_SEMAPHORE_LIMIT_EXCEEDED, "NtReleaseSemaphore failed %08lx\n", status );
+ ok( prev == 0xdeadbeef, "NtReleaseSemaphore failed, expected 0xdeadbeef, got %ld\n", prev );
memset(&info, 0xcc, sizeof(info));
status = pNtQuerySemaphore(semaphore, SemaphoreBasicInformation, &info, sizeof(info), NULL);
- ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08x\n", status );
- ok( info.CurrentCount == 2, "expected 2, got %d\n", info.CurrentCount );
- ok( info.MaximumCount == 2, "expected 2, got %d\n", info.MaximumCount );
+ ok( status == STATUS_SUCCESS, "NtQuerySemaphore failed %08lx\n", status );
+ ok( info.CurrentCount == 2, "expected 2, got %ld\n", info.CurrentCount );
+ ok( info.MaximumCount == 2, "expected 2, got %ld\n", info.MaximumCount );
NtClose( semaphore );
}
@@ -558,7 +559,7 @@ static void test_wait_on_address(void)
address = 0;
compare = 0;
status = pRtlWaitOnAddress(&address, &compare, 5, NULL);
- ok(status == STATUS_INVALID_PARAMETER, "got %x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got %lx\n", status);
/* values match */
address = 0;
@@ -567,9 +568,9 @@ static void test_wait_on_address(void)
timeout.QuadPart = start.QuadPart + 100 * 10000;
status = pRtlWaitOnAddress(&address, &compare, 8, &timeout);
pNtQuerySystemTime(&end);
- ok(status == STATUS_TIMEOUT, "got 0x%08x\n", status);
+ ok(status == STATUS_TIMEOUT, "got 0x%08lx\n", status);
elapsed = (end.QuadPart - start.QuadPart) / 10000;
- ok(90 <= elapsed && elapsed <= 900, "timed out in %u ms\n", elapsed);
+ ok(90 <= elapsed && elapsed <= 900, "timed out in %lu ms\n", elapsed);
ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
ok(compare == 0, "got %s\n", wine_dbgstr_longlong(compare));
@@ -583,17 +584,17 @@ static void test_wait_on_address(void)
timeout.QuadPart = -100 * 10000;
status = pRtlWaitOnAddress(&address, &compare, size, &timeout);
pNtQuerySystemTime(&end);
- ok(status == STATUS_TIMEOUT, "got 0x%08x\n", status);
+ ok(status == STATUS_TIMEOUT, "got 0x%08lx\n", status);
elapsed = (end.QuadPart - start.QuadPart) / 10000;
- ok(90 <= elapsed && elapsed <= 900, "timed out in %u ms\n", elapsed);
+ ok(90 <= elapsed && elapsed <= 900, "timed out in %lu ms\n", elapsed);
status = pRtlWaitOnAddress(&address, &compare, size << 1, &timeout);
- ok(!status, "got 0x%08x\n", status);
+ ok(!status, "got 0x%08lx\n", status);
}
address = 0;
compare = 1;
status = pRtlWaitOnAddress(&address, &compare, 8, NULL);
- ok(!status, "got 0x%08x\n", status);
+ ok(!status, "got 0x%08lx\n", status);
/* no waiters */
address = 0;
@@ -761,10 +762,10 @@ static DWORD WINAPI tid_alert_thread( void *arg )
NTSTATUS ret;
ret = pNtAlertThreadByThreadId( arg );
- ok(!ret, "got %#x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = pNtWaitForAlertByThreadId( (void *)0x123, NULL );
- ok(ret == STATUS_ALERTED, "got %#x\n", ret);
+ ok(ret == STATUS_ALERTED, "got %#lx\n", ret);
return 0;
}
@@ -786,52 +787,52 @@ static void test_tid_alert( char **argv )
}
ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout );
- ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
+ ok(ret == STATUS_TIMEOUT, "got %#lx\n", ret);
ret = pNtAlertThreadByThreadId( 0 );
- ok(ret == STATUS_INVALID_CID, "got %#x\n", ret);
+ ok(ret == STATUS_INVALID_CID, "got %#lx\n", ret);
ret = pNtAlertThreadByThreadId( (HANDLE)0xdeadbeef );
- ok(ret == STATUS_INVALID_CID, "got %#x\n", ret);
+ ok(ret == STATUS_INVALID_CID, "got %#lx\n", ret);
ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)GetCurrentThreadId() );
- ok(!ret, "got %#x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)GetCurrentThreadId() );
- ok(!ret, "got %#x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout );
- ok(ret == STATUS_ALERTED, "got %#x\n", ret);
+ ok(ret == STATUS_ALERTED, "got %#lx\n", ret);
ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout );
- ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
+ ok(ret == STATUS_TIMEOUT, "got %#lx\n", ret);
ret = pNtWaitForAlertByThreadId( (void *)0x321, &timeout );
- ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
+ ok(ret == STATUS_TIMEOUT, "got %#lx\n", ret);
thread = CreateThread( NULL, 0, tid_alert_thread, (HANDLE)(DWORD_PTR)GetCurrentThreadId(), 0, &tid );
timeout.QuadPart = -1000 * 10000;
ret = pNtWaitForAlertByThreadId( (void *)0x123, &timeout );
- ok(ret == STATUS_ALERTED, "got %#x\n", ret);
+ ok(ret == STATUS_ALERTED, "got %#lx\n", ret);
ret = WaitForSingleObject( thread, 100 );
- ok(ret == WAIT_TIMEOUT, "got %d\n", ret);
+ ok(ret == WAIT_TIMEOUT, "got %ld\n", ret);
ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)tid );
- ok(!ret, "got %#x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = WaitForSingleObject( thread, 1000 );
- ok(!ret, "got %d\n", ret);
+ ok(!ret, "got %ld\n", ret);
ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)tid );
- ok(!ret, "got %#x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
CloseHandle(thread);
sprintf( cmdline, "%s %s subprocess", argv[0], argv[1] );
ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
- ok(ret, "failed to create process, error %u\n", GetLastError());
+ ok(ret, "failed to create process, error %lu\n", GetLastError());
ret = pNtAlertThreadByThreadId( (HANDLE)(DWORD_PTR)pi.dwThreadId );
- todo_wine ok(ret == STATUS_ACCESS_DENIED, "got %#x\n", ret);
+ todo_wine ok(ret == STATUS_ACCESS_DENIED, "got %#lx\n", ret);
ok(!WaitForSingleObject( pi.hProcess, 1000 ), "wait failed\n");
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
1
0
March 23, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/string.c | 47 +++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c
index 6939dd3c15e..eabbe86792b 100644
--- a/dlls/ntdll/tests/string.c
+++ b/dlls/ntdll/tests/string.c
@@ -20,6 +20,7 @@
* We use function pointers here as there is no import library for NTDLL on
* windows.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h>
#include <limits.h>
@@ -308,10 +309,10 @@ static void one_ltoa_test(int test_num, const ulong2str_t *ulong2str)
value = ulong2str->value;
result = p_ltoa(ulong2str->value, dest_str, ulong2str->base);
ok(result == dest_str,
- "(test %d): _ltoa(%d, [out], %d) has result %p, expected: %p\n",
+ "(test %d): _ltoa(%ld, [out], %d) has result %p, expected: %p\n",
test_num, value, ulong2str->base, result, dest_str);
ok(memcmp(dest_str, ulong2str->Buffer, LARGE_STRI_BUFFER_LENGTH) == 0,
- "(test %d): _ltoa(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): _ltoa(%ld, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
test_num, value, ulong2str->base, dest_str, ulong2str->Buffer);
}
@@ -327,10 +328,10 @@ static void one_ultoa_test(int test_num, const ulong2str_t *ulong2str)
value = ulong2str->value;
result = p_ultoa(ulong2str->value, dest_str, ulong2str->base);
ok(result == dest_str,
- "(test %d): _ultoa(%u, [out], %d) has result %p, expected: %p\n",
+ "(test %d): _ultoa(%lu, [out], %d) has result %p, expected: %p\n",
test_num, value, ulong2str->base, result, dest_str);
ok(memcmp(dest_str, ulong2str->Buffer, LARGE_STRI_BUFFER_LENGTH) == 0,
- "(test %d): _ultoa(%u, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): _ultoa(%lu, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
test_num, value, ulong2str->base, dest_str, ulong2str->Buffer);
}
@@ -415,10 +416,10 @@ static void one_ltow_test(int test_num, const ulong2str_t *ulong2str)
result = p_ltow(value, dest_wstr, ulong2str->base);
pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
ok(result == dest_wstr,
- "(test %d): _ltow(%d, [out], %d) has result %p, expected: %p\n",
+ "(test %d): _ltow(%ld, [out], %d) has result %p, expected: %p\n",
test_num, value, ulong2str->base, result, dest_wstr);
ok(memcmp(dest_wstr, expected_wstr, LARGE_STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
- "(test %d): _ltow(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): _ltow(%ld, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
test_num, value, ulong2str->base, ansi_str.Buffer, ulong2str->Buffer);
pRtlFreeAnsiString(&ansi_str);
}
@@ -451,10 +452,10 @@ static void one_ultow_test(int test_num, const ulong2str_t *ulong2str)
result = p_ultow(value, dest_wstr, ulong2str->base);
pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
ok(result == dest_wstr,
- "(test %d): _ultow(%u, [out], %d) has result %p, expected: %p\n",
+ "(test %d): _ultow(%lu, [out], %d) has result %p, expected: %p\n",
test_num, value, ulong2str->base, result, dest_wstr);
ok(memcmp(dest_wstr, expected_wstr, LARGE_STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
- "(test %d): _ultow(%u, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): _ultow(%lu, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
test_num, value, ulong2str->base, ansi_str.Buffer, ulong2str->Buffer);
pRtlFreeAnsiString(&ansi_str);
}
@@ -481,7 +482,7 @@ static void test_ulongtow(void)
/* Crashes on XP and W2K3 */
result = p_itow(ulong2str[0].value, NULL, 10);
ok(result == NULL,
- "(test a): _itow(%d, NULL, 10) has result %p, expected: NULL\n",
+ "(test a): _itow(%ld, NULL, 10) has result %p, expected: NULL\n",
ulong2str[0].value, result);
}
@@ -489,7 +490,7 @@ static void test_ulongtow(void)
/* Crashes on XP and W2K3 */
result = p_ltow(ulong2str[0].value, NULL, 10);
ok(result == NULL,
- "(test b): _ltow(%d, NULL, 10) has result %p, expected: NULL\n",
+ "(test b): _ltow(%ld, NULL, 10) has result %p, expected: NULL\n",
ulong2str[0].value, result);
}
@@ -497,7 +498,7 @@ static void test_ulongtow(void)
/* Crashes on XP and W2K3 */
result = p_ultow(ulong2str[0].value, NULL, 10);
ok(result == NULL,
- "(test c): _ultow(%d, NULL, 10) has result %p, expected: NULL\n",
+ "(test c): _ultow(%ld, NULL, 10) has result %p, expected: NULL\n",
ulong2str[0].value, result);
}
}
@@ -959,7 +960,7 @@ static void test_wtoi(void)
pRtlCreateUnicodeStringFromAsciiz(&uni, str2long[test_num].str);
result = p_wtoi(uni.Buffer);
ok(result == str2long[test_num].value,
- "(test %d): call failed: _wtoi(\"%s\") has result %d, expected: %d\n",
+ "(test %d): call failed: _wtoi(\"%s\") has result %d, expected: %ld\n",
test_num, str2long[test_num].str, result, str2long[test_num].value);
pRtlFreeUnicodeString(&uni);
} /* for */
@@ -973,7 +974,7 @@ static void test_atoi(void)
for (test_num = 0; test_num < ARRAY_SIZE(str2long); test_num++) {
result = patoi(str2long[test_num].str);
ok(result == str2long[test_num].value,
- "(test %d): call failed: _atoi(\"%s\") has result %d, expected: %d\n",
+ "(test %d): call failed: _atoi(\"%s\") has result %d, expected: %ld\n",
test_num, str2long[test_num].str, result, str2long[test_num].value);
}
}
@@ -986,7 +987,7 @@ static void test_atol(void)
for (test_num = 0; test_num < ARRAY_SIZE(str2long); test_num++) {
result = patol(str2long[test_num].str);
ok(result == str2long[test_num].value,
- "(test %d): call failed: _atol(\"%s\") has result %d, expected: %d\n",
+ "(test %d): call failed: _atol(\"%s\") has result %d, expected: %ld\n",
test_num, str2long[test_num].str, result, str2long[test_num].value);
}
}
@@ -1001,14 +1002,14 @@ static void test_wtol(void)
pRtlCreateUnicodeStringFromAsciiz(&uni, str2long[test_num].str);
result = p_wtol(uni.Buffer);
ok(result == str2long[test_num].value,
- "(test %d): call failed: _wtol(\"%s\") has result %d, expected: %d\n",
+ "(test %d): call failed: _wtol(\"%s\") has result %ld, expected: %ld\n",
test_num, str2long[test_num].str, result, str2long[test_num].value);
pRtlFreeUnicodeString(&uni);
}
result = p_wtol( L"\t\xa0\n 12" );
- ok( result == 12, "got %d\n", result );
+ ok( result == 12, "got %ld\n", result );
result = p_wtol( L"\x3000 12" );
- ok( result == 0, "got %d\n", result );
+ ok( result == 0, "got %ld\n", result );
}
@@ -1231,10 +1232,10 @@ static void test_wcstol(void)
for (i = 0; i < ARRAY_SIZE(tests); i++)
{
res = pwcstol( tests[i].str, &endpos, tests[i].base );
- ok( res == tests[i].res, "%u: %s res %08x\n", i, wine_dbgstr_w(tests[i].str), res );
+ ok( res == tests[i].res, "%u: %s res %08lx\n", i, wine_dbgstr_w(tests[i].str), res );
if (!res) ok( endpos == tests[i].str, "%u: wrong endpos %p/%p\n", i, endpos, tests[i].str );
ures = pwcstoul( tests[i].str, &endpos, tests[i].base );
- ok( ures == tests[i].ures, "%u: %s res %08x\n", i, wine_dbgstr_w(tests[i].str), ures );
+ ok( ures == tests[i].ures, "%u: %s res %08lx\n", i, wine_dbgstr_w(tests[i].str), ures );
}
/* Test various unicode digits */
@@ -1242,14 +1243,14 @@ static void test_wcstol(void)
{
WCHAR tmp[] = { zeros[i] + 4, zeros[i], zeros[i] + 5, 0 };
res = pwcstol(tmp, NULL, 0);
- ok(res == 405, "with zero = U+%04X: got %d, expected 405\n", zeros[i], res);
+ ok(res == 405, "with zero = U+%04X: got %ld, expected 405\n", zeros[i], res);
ures = pwcstoul(tmp, NULL, 0);
- ok(ures == 405, "with zero = U+%04X: got %u, expected 405\n", zeros[i], ures);
+ ok(ures == 405, "with zero = U+%04X: got %lu, expected 405\n", zeros[i], ures);
tmp[1] = zeros[i] + 10;
res = pwcstol(tmp, NULL, 16);
- ok(res == 4, "with zero = U+%04X: got %d, expected 4\n", zeros[i], res);
+ ok(res == 4, "with zero = U+%04X: got %ld, expected 4\n", zeros[i], res);
ures = pwcstoul(tmp, NULL, 16);
- ok(ures == 4, "with zero = U+%04X: got %u, expected 4\n", zeros[i], ures);
+ ok(ures == 4, "with zero = U+%04X: got %lu, expected 4\n", zeros[i], ures);
}
}
1
0
March 23, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtlstr.c | 265 +++++++++++++++++++++++----------------------
1 file changed, 133 insertions(+), 132 deletions(-)
diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c
index 9f7e5df9f67..09a3333dad6 100644
--- a/dlls/ntdll/tests/rtlstr.c
+++ b/dlls/ntdll/tests/rtlstr.c
@@ -21,6 +21,7 @@
* We use function pointers here as there is no import library for NTDLL on
* windows.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h>
@@ -220,7 +221,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, teststring);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected 0\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
result);
ok(uni.Length == 32,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
@@ -251,7 +252,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, teststring2);
ok(result == STATUS_NAME_TOO_LONG,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected %x\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
result, STATUS_NAME_TOO_LONG);
ok(uni.Length == 12345 ||
uni.Length == 0, /* win2k3 */
@@ -287,7 +288,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, 0);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected 0\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
result);
ok(uni.Length == 0,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
@@ -470,7 +471,7 @@ static void test_RtlDuplicateUnicodeString(void)
dest_ansi_buf[dest_ansi_str.Length] = '\0';
dest_ansi_str.Buffer = dest_ansi_buf;
ok(result == dupl_ustr[test_num].result,
- "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has result %x, expected %x\n",
+ "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has result %lx, expected %lx\n",
test_num, dupl_ustr[test_num].add_nul, result, dupl_ustr[test_num].result);
ok(dest_str.Length == dupl_ustr[test_num].res_Length,
"(test %d): RtlDuplicateUnicodeString(%d, source, dest) destination has Length %d, expected %d\n",
@@ -828,7 +829,7 @@ static void test_RtlUnicodeStringToAnsiString(void)
}
result = pRtlUnicodeStringToAnsiString(&ansi_str, &uni_str, ustr2astr[test_num].doalloc);
ok(result == ustr2astr[test_num].result,
- "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %x, expected %x\n",
+ "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %lx, expected %lx\n",
test_num, ustr2astr[test_num].doalloc, result, ustr2astr[test_num].result);
ok(ansi_str.Length == ustr2astr[test_num].res_Length,
"(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) ansi has Length %d, expected %d\n",
@@ -890,7 +891,7 @@ static void test_RtlAppendAsciizToString(void)
}
result = pRtlAppendAsciizToString(&dest_str, app_asc2str[test_num].src);
ok(result == app_asc2str[test_num].result,
- "(test %d): RtlAppendAsciizToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendAsciizToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_asc2str[test_num].result);
ok(dest_str.Length == app_asc2str[test_num].res_Length,
"(test %d): RtlAppendAsciizToString(dest, src) dest has Length %d, expected %d\n",
@@ -970,7 +971,7 @@ static void test_RtlAppendStringToString(void)
}
result = pRtlAppendStringToString(&dest_str, &src_str);
ok(result == app_str2str[test_num].result,
- "(test %d): RtlAppendStringToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_str2str[test_num].result);
ok(dest_str.Length == app_str2str[test_num].res_Length,
"(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
@@ -1041,7 +1042,7 @@ static void test_RtlAppendUnicodeToString(void)
}
result = pRtlAppendUnicodeToString(&dest_str, (LPCWSTR) app_uni2str[test_num].src);
ok(result == app_uni2str[test_num].result,
- "(test %d): RtlAppendUnicodeToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendUnicodeToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_uni2str[test_num].result);
ok(dest_str.Length == app_uni2str[test_num].res_Length,
"(test %d): RtlAppendUnicodeToString(dest, src) dest has Length %d, expected %d\n",
@@ -1125,7 +1126,7 @@ static void test_RtlAppendUnicodeStringToString(void)
}
result = pRtlAppendUnicodeStringToString(&dest_str, &src_str);
ok(result == app_ustr2str[test_num].result,
- "(test %d): RtlAppendStringToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_ustr2str[test_num].result);
ok(dest_str.Length == app_ustr2str[test_num].res_Length,
"(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
@@ -1249,7 +1250,7 @@ static void test_RtlFindCharInUnicodeString(void)
pos = 12345;
result = pRtlFindCharInUnicodeString(find_ch_in_ustr[test_num].flags, &main_str, &search_chars, &pos);
ok(result == find_ch_in_ustr[test_num].result,
- "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) has result %x, expected %x\n",
+ "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) has result %lx, expected %lx\n",
test_num, find_ch_in_ustr[test_num].flags,
find_ch_in_ustr[test_num].main_str, find_ch_in_ustr[test_num].search_chars,
result, find_ch_in_ustr[test_num].result);
@@ -1400,7 +1401,7 @@ static void test_RtlUnicodeStringToInteger(void)
result = pRtlUnicodeStringToInteger(&uni, str2int[test_num].base, &value);
ok(result == str2int[test_num].result ||
(str2int[test_num].alternative && result == str2int[test_num].alternative),
- "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) has result %x, expected: %x (%x)\n",
+ "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
test_num, str2int[test_num].str, str2int[test_num].base, result,
str2int[test_num].result, str2int[test_num].alternative);
if (result == STATUS_SUCCESS)
@@ -1419,17 +1420,17 @@ static void test_RtlUnicodeStringToInteger(void)
pRtlInitUnicodeString(&uni, wstr);
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlUnicodeStringToInteger(\"%s\", %d, NULL) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"%s\", %d, NULL) has result %lx\n",
str2int[1].str, str2int[1].base, result);
result = pRtlUnicodeStringToInteger(&uni, 20, NULL);
ok(result == STATUS_INVALID_PARAMETER || result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlUnicodeStringToInteger(\"%s\", 20, NULL) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"%s\", 20, NULL) has result %lx\n",
str2int[1].str, result);
uni.Length = 10; /* Make Length shorter (5 WCHARS instead of 7) */
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS,
- "call failed: RtlUnicodeStringToInteger(\"12345\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"12345\", %d, [out]) has result %lx\n",
str2int[1].base, result);
ok(value == 12345,
"didn't return expected value (test a): expected: %d, got: %d\n",
@@ -1438,7 +1439,7 @@ static void test_RtlUnicodeStringToInteger(void)
uni.Length = 5; /* Use odd Length (2.5 WCHARS) */
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS || result == STATUS_INVALID_PARAMETER /* vista */,
- "call failed: RtlUnicodeStringToInteger(\"12\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"12\", %d, [out]) has result %lx\n",
str2int[1].base, result);
if (result == STATUS_SUCCESS)
ok(value == 12, "didn't return expected value (test b): expected: %d, got: %d\n", 12, value);
@@ -1446,7 +1447,7 @@ static void test_RtlUnicodeStringToInteger(void)
uni.Length = 2;
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS,
- "call failed: RtlUnicodeStringToInteger(\"1\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"1\", %d, [out]) has result %lx\n",
str2int[1].base, result);
ok(value == 1,
"didn't return expected value (test c): expected: %d, got: %d\n",
@@ -1469,7 +1470,7 @@ static void test_RtlCharToInteger(void)
result = pRtlCharToInteger(str2int[test_num].str, str2int[test_num].base, &value);
ok(result == str2int[test_num].result ||
(str2int[test_num].alternative && result == str2int[test_num].alternative),
- "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) has result %x, expected: %x (%x)\n",
+ "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
test_num, str2int[test_num].str, str2int[test_num].base, result,
str2int[test_num].result, str2int[test_num].alternative);
if (result == STATUS_SUCCESS)
@@ -1485,12 +1486,12 @@ static void test_RtlCharToInteger(void)
result = pRtlCharToInteger(str2int[1].str, str2int[1].base, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlCharToInteger(\"%s\", %d, NULL) has result %x\n",
+ "call failed: RtlCharToInteger(\"%s\", %d, NULL) has result %lx\n",
str2int[1].str, str2int[1].base, result);
result = pRtlCharToInteger(str2int[1].str, 20, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "call failed: RtlCharToInteger(\"%s\", 20, NULL) has result %x\n",
+ "call failed: RtlCharToInteger(\"%s\", 20, NULL) has result %lx\n",
str2int[1].str, result);
}
@@ -1657,22 +1658,22 @@ static void one_RtlIntegerToUnicodeString_test(int test_num, const int2str_t *in
}
} else {
ok(result == int2str->result,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) has result %x, expected: %x\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) has result %lx, expected: %lx\n",
test_num, int2str->value, int2str->base, result, int2str->result);
if (result == STATUS_SUCCESS) {
ok(unicode_string.Buffer[unicode_string.Length/sizeof(WCHAR)] == '\0',
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string \"%s\" is not NULL terminated\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string \"%s\" is not NULL terminated\n",
test_num, int2str->value, int2str->base, ansi_str.Buffer);
}
}
ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
test_num, int2str->value, int2str->base, ansi_str.Buffer, expected_ansi_str.Buffer);
ok(unicode_string.Length == expected_unicode_string.Length,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string has Length %d, expected: %d\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has Length %d, expected: %d\n",
test_num, int2str->value, int2str->base, unicode_string.Length, expected_unicode_string.Length);
ok(unicode_string.MaximumLength == expected_unicode_string.MaximumLength,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string has MaximumLength %d, expected: %d\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has MaximumLength %d, expected: %d\n",
test_num, int2str->value, int2str->base, unicode_string.MaximumLength, expected_unicode_string.MaximumLength);
pRtlFreeAnsiString(&expected_ansi_str);
pRtlFreeAnsiString(&ansi_str);
@@ -1697,10 +1698,10 @@ static void one_RtlIntegerToChar_test(int test_num, const int2str_t *int2str)
dest_str[STRI_BUFFER_LENGTH] = '\0';
result = pRtlIntegerToChar(int2str->value, int2str->base, int2str->MaximumLength, dest_str);
ok(result == int2str->result,
- "(test %d): RtlIntegerToChar(%u, %d, %d, [out]) has result %x, expected: %x\n",
+ "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) has result %lx, expected: %lx\n",
test_num, int2str->value, int2str->base, int2str->MaximumLength, result, int2str->result);
ok(memcmp(dest_str, int2str->Buffer, STRI_BUFFER_LENGTH) == 0,
- "(test %d): RtlIntegerToChar(%u, %d, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
test_num, int2str->value, int2str->base, int2str->MaximumLength, dest_str, int2str->Buffer);
}
@@ -1715,22 +1716,22 @@ static void test_RtlIntegerToChar(void)
result = pRtlIntegerToChar(int2str[0].value, 20, int2str[0].MaximumLength, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "(test a): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test a): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, 20, int2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, 20, 0, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "(test b): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test b): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, 20, 0, result, STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base, 0, NULL);
ok(result == STATUS_BUFFER_OVERFLOW,
- "(test c): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test c): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, int2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base, int2str[0].MaximumLength, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "(test d): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test d): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, int2str[0].base, int2str[0].MaximumLength, result, STATUS_ACCESS_VIOLATION);
}
@@ -1883,17 +1884,17 @@ static void test_RtlCompareUnicodeString(void)
for (ch2 = 0; ch2 < 1024; ch2++)
{
LONG res = pRtlCompareUnicodeString( &str1, &str2, FALSE );
- ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ ok( res == (ch1 - ch2), "wrong result %ld %04x %04x\n", res, ch1, ch2 );
res = pRtlCompareUnicodeString( &str1, &str2, TRUE );
ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
- "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ "wrong result %ld %04x %04x\n", res, ch1, ch2 );
if (pRtlCompareUnicodeStrings)
{
res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, FALSE );
- ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ ok( res == (ch1 - ch2), "wrong result %ld %04x %04x\n", res, ch1, ch2 );
res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, TRUE );
ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
- "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ "wrong result %ld %04x %04x\n", res, ch1, ch2 );
}
}
}
@@ -1924,7 +1925,7 @@ static void test_RtlGUIDFromString(void)
str.Buffer = (LPWSTR)szGuid;
ret = pRtlGUIDFromString(&str, &guid);
- ok(ret == 0, "expected ret=0, got 0x%0x\n", ret);
+ ok(ret == 0, "expected ret=0, got 0x%0lx\n", ret);
ok(IsEqualGUID(&guid, &IID_Endianness), "Endianness broken\n");
str.Length = str.MaximumLength = sizeof(szGuid2) - sizeof(WCHAR);
@@ -1949,7 +1950,7 @@ static void test_RtlStringFromGUID(void)
str.Buffer = NULL;
ret = pRtlStringFromGUID(&IID_Endianness, &str);
- ok(ret == 0, "expected ret=0, got 0x%0x\n", ret);
+ ok(ret == 0, "expected ret=0, got 0x%0lx\n", ret);
ok(str.Buffer && !lstrcmpiW(str.Buffer, szGuid), "Endianness broken\n");
pRtlFreeUnicodeString(&str);
}
@@ -1991,22 +1992,22 @@ static void test_RtlHashUnicodeString(void)
}
status = pRtlHashUnicodeString(NULL, FALSE, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
pRtlInitUnicodeString(&str, strW);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_X65599, NULL);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_INVALID, &hash);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
/* embedded null */
str.Buffer = (PWSTR)strW;
str.Length = sizeof(strW) - sizeof(WCHAR);
str.MaximumLength = sizeof(strW);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_SUCCESS, "got status 0x%08x\n", status);
- ok(hash == 0x32803083, "got 0x%08x\n", hash);
+ ok(status == STATUS_SUCCESS, "got status 0x%08lx\n", status);
+ ok(hash == 0x32803083, "got 0x%08lx\n", hash);
ptr = hash_test;
while (*ptr->str)
@@ -2014,8 +2015,8 @@ static void test_RtlHashUnicodeString(void)
pRtlInitUnicodeString(&str, ptr->str);
hash = 0;
status = pRtlHashUnicodeString(&str, ptr->case_insensitive, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_SUCCESS, "got status 0x%08x for %s\n", status, wine_dbgstr_w(ptr->str));
- ok(hash == ptr->hash, "got wrong hash 0x%08x, expected 0x%08x, for %s, mode %d\n", hash, ptr->hash,
+ ok(status == STATUS_SUCCESS, "got status 0x%08lx for %s\n", status, wine_dbgstr_w(ptr->str));
+ ok(hash == ptr->hash, "got wrong hash 0x%08lx, expected 0x%08lx, for %s, mode %d\n", hash, ptr->hash,
wine_dbgstr_w(ptr->str), ptr->case_insensitive);
ptr++;
@@ -2078,8 +2079,8 @@ static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG ou
status = pRtlUnicodeToUTF8N(
out_string ? buffer : NULL, buflen, &bytes_out,
in_string, in_bytes);
- ok_(__FILE__, line)(status == expect_status, "status 0x%x, expected 0x%x\n", status, expect_status);
- ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u, expected %u\n", bytes_out, out_bytes);
+ ok_(__FILE__, line)(status == expect_status, "status 0x%lx, expected 0x%lx\n", status, expect_status);
+ ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %lu, expected %lu\n", bytes_out, out_bytes);
if (out_string)
{
for (i = 0; i < bytes_out; i++)
@@ -2120,51 +2121,51 @@ static void test_RtlUnicodeToUTF8N(void)
/* show that bytes_out is really ULONG */
memset(bytes_out_array, 0x55, sizeof(bytes_out_array));
status = pRtlUnicodeToUTF8N(NULL, 0, bytes_out_array, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]);
- ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out_array[0] == 0x00000000, "Got 0x%lx\n", bytes_out_array[0]);
+ ok(bytes_out_array[1] == 0x55555555, "Got 0x%lx\n", bytes_out_array[1]);
/* parameter checks */
status = pRtlUnicodeToUTF8N(NULL, 0, NULL, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
status = pRtlUnicodeToUTF8N(NULL, 0, NULL, empty_string, 0);
- ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "status = 0x%lx\n", status);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, invalid_pointer, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, test_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(invalid_pointer, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(invalid_pointer, 8, &bytes_out, empty_string, 1);
- ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
/* length output with special chars */
#define length_expect(in_chars, out_bytes, expect_status) \
@@ -2184,14 +2185,14 @@ static void test_RtlUnicodeToUTF8N(void)
memset(buffer, 0x55, sizeof(buffer));
bytes_out = 0xdeadbeef;
status = pRtlUnicodeToUTF8N(buffer, i, &bytes_out, special_string, sizeof(special_string));
- ok(status == STATUS_BUFFER_TOO_SMALL, "%d: status = 0x%x\n", i, status);
- ok(bytes_out == special_string_len[i], "%d: expected %u, got %u\n", i, special_string_len[i], bytes_out);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "%d: status = 0x%lx\n", i, status);
+ ok(bytes_out == special_string_len[i], "%d: expected %lu, got %lu\n", i, special_string_len[i], bytes_out);
ok(memcmp(buffer, special_expected, special_string_len[i]) == 0, "%d: bad conversion\n", i);
}
status = pRtlUnicodeToUTF8N(buffer, 7, &bytes_out, special_string, sizeof(special_string));
- ok(status == STATUS_SOME_NOT_MAPPED, "status = 0x%x\n", status);
- ok(bytes_out == special_string_len[7], "expected %u, got %u\n", special_string_len[7], bytes_out);
+ ok(status == STATUS_SOME_NOT_MAPPED, "status = 0x%lx\n", status);
+ ok(bytes_out == special_string_len[7], "expected %lu, got %lu\n", special_string_len[7], bytes_out);
ok(memcmp(buffer, special_expected, 7) == 0, "bad conversion\n");
/* conversion behavior with varying input length */
@@ -2208,9 +2209,9 @@ static void test_RtlUnicodeToUTF8N(void)
test_string, input_len);
if (input_len % sizeof(WCHAR) == 0) {
ok(status == STATUS_SUCCESS,
- "(len %u): status = 0x%x\n", input_len, status);
+ "(len %u): status = 0x%lx\n", input_len, status);
ok(bytes_out == input_len / sizeof(WCHAR),
- "(len %u): bytes_out = 0x%x\n", input_len, bytes_out);
+ "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
for (i = 0; i < bytes_out; i++) {
ok(buffer[i] == test_string[i],
"(len %u): buffer[%d] = 0x%x, expected 0x%x\n",
@@ -2222,9 +2223,9 @@ static void test_RtlUnicodeToUTF8N(void)
}
} else {
ok(status == STATUS_INVALID_PARAMETER_5,
- "(len %u): status = 0x%x\n", input_len, status);
+ "(len %u): status = 0x%lx\n", input_len, status);
ok(bytes_out == 0x55555555,
- "(len %u): bytes_out = 0x%x\n", input_len, bytes_out);
+ "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
for (i = 0; i < sizeof(buffer); i++) {
ok(buffer[i] == 0x55,
"(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]);
@@ -2240,14 +2241,14 @@ static void test_RtlUnicodeToUTF8N(void)
buffer, sizeof(buffer), &bytes_out,
unicode_to_utf8[i].unicode, lstrlenW(unicode_to_utf8[i].unicode) * sizeof(WCHAR));
ok(status == unicode_to_utf8[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, unicode_to_utf8[i].status);
ok(bytes_out == strlen(unicode_to_utf8[i].expected),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %u\n",
i, bytes_out, lstrlenA(unicode_to_utf8[i].expected));
ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out),
"(test %d): got \"%.*s\", expected \"%s\"\n",
- i, bytes_out, buffer, unicode_to_utf8[i].expected);
+ i, (int)bytes_out, buffer, unicode_to_utf8[i].expected);
ok(buffer[bytes_out] == 0x55,
"(test %d): behind string: 0x%x\n", i, buffer[bytes_out]);
memset(buffer, 0x55, sizeof(buffer));
@@ -2266,14 +2267,14 @@ static void test_RtlUnicodeToUTF8N(void)
buffer, sizeof(buffer), &bytes_out,
unicode_to_utf8[i].unicode, (lstrlenW(unicode_to_utf8[i].unicode) + 1) * sizeof(WCHAR));
ok(status == unicode_to_utf8[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, unicode_to_utf8[i].status);
ok(bytes_out == strlen(unicode_to_utf8[i].expected) + 1,
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %u\n",
i, bytes_out, lstrlenA(unicode_to_utf8[i].expected) + 1);
ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out),
"(test %d): got \"%.*s\", expected \"%s\"\n",
- i, bytes_out, buffer, unicode_to_utf8[i].expected);
+ i, (int)bytes_out, buffer, unicode_to_utf8[i].expected);
ok(buffer[bytes_out] == 0x55,
"(test %d): behind string: 0x%x\n", i, buffer[bytes_out]);
memset(buffer, 0x55, sizeof(buffer));
@@ -2290,7 +2291,7 @@ static void test_RtlUnicodeToUTF8N(void)
if (unicode_to_utf8[i].status == STATUS_SOME_NOT_MAPPED)
{
ok( ret == 0, "(test %d): wrong len %u\n", i, ret );
- ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %u\n", i, GetLastError() );
+ ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %lu\n", i, GetLastError() );
ret = strlen(unicode_to_utf8[i].expected) + 1;
}
else
@@ -2410,9 +2411,9 @@ static void unicode_expect_(const WCHAR *out_string, ULONG buflen, ULONG out_cha
status = pRtlUTF8ToUnicodeN(
out_string ? buffer : NULL, buflen, &bytes_out,
in_string, in_chars);
- ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status);
+ ok_(__FILE__, line)(status == expect_status, "status = 0x%lx\n", status);
ok_(__FILE__, line)(bytes_out == out_chars * sizeof(WCHAR),
- "bytes_out = %u, expected %u\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR));
+ "bytes_out = %lu, expected %lu\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR));
if (out_string)
{
for (i = 0; i < bytes_out / sizeof(WCHAR); i++)
@@ -2453,41 +2454,41 @@ static void test_RtlUTF8ToUnicodeN(void)
/* show that bytes_out is really ULONG */
memset(bytes_out_array, 0x55, sizeof(bytes_out_array));
status = pRtlUTF8ToUnicodeN(NULL, 0, bytes_out_array, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]);
- ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out_array[0] == 0x00000000, "Got 0x%lx\n", bytes_out_array[0]);
+ ok(bytes_out_array[1] == 0x55555555, "Got 0x%lx\n", bytes_out_array[1]);
/* parameter checks */
status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, empty_string, 0);
- ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "status = 0x%lx\n", status);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, invalid_pointer, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, test_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%lx\n", bytes_out);
/* length output with special chars */
#define length_expect(in_chars, out_chars, expect_status) \
@@ -2543,10 +2544,10 @@ static void test_RtlUTF8ToUnicodeN(void)
buffer, sizeof(buffer), &bytes_out,
utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8));
ok(status == utf8_to_unicode[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, utf8_to_unicode[i].status);
ok(bytes_out == lstrlenW(utf8_to_unicode[i].expected) * sizeof(WCHAR),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %lu\n",
i, bytes_out, lstrlenW(utf8_to_unicode[i].expected) * (ULONG)sizeof(WCHAR));
ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out),
"(test %d): got %s, expected %s\n",
@@ -2570,10 +2571,10 @@ static void test_RtlUTF8ToUnicodeN(void)
buffer, sizeof(buffer), &bytes_out,
utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8) + 1);
ok(status == utf8_to_unicode[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, utf8_to_unicode[i].status);
ok(bytes_out == (lstrlenW(utf8_to_unicode[i].expected) + 1) * sizeof(WCHAR),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %lu\n",
i, bytes_out, (lstrlenW(utf8_to_unicode[i].expected) + 1) * (ULONG)sizeof(WCHAR));
ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out),
"(test %d): got %s, expected %s\n",
@@ -2597,7 +2598,7 @@ static void test_RtlUTF8ToUnicodeN(void)
if (utf8_to_unicode[i].status == STATUS_SOME_NOT_MAPPED)
{
ok( ret == 0, "(test %d): wrong len %u\n", i, ret );
- ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %u\n", i, GetLastError() );
+ ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %lu\n", i, GetLastError() );
ret = lstrlenW(utf8_to_unicode[i].expected) + 1;
}
else
@@ -2635,10 +2636,10 @@ static void WINAPIV testfmt( const WCHAR *src, const WCHAR *expect, ULONG width,
va_start( args, ansi );
status = pRtlFormatMessage( src, width, FALSE, ansi, FALSE, &args, buffer, sizeof(buffer), &size );
va_end( args );
- ok( !status, "%s: failed %x\n", debugstr_w(src), status );
+ ok( !status, "%s: failed %lx\n", debugstr_w(src), status );
ok( !lstrcmpW( buffer, expect ), "%s: got %s expected %s\n", debugstr_w(src),
debugstr_w(buffer), debugstr_w(expect) );
- ok( size == (lstrlenW(expect) + 1) * sizeof(WCHAR), "%s: wrong size %u\n", debugstr_w(src), size );
+ ok( size == (lstrlenW(expect) + 1) * sizeof(WCHAR), "%s: wrong size %lu\n", debugstr_w(src), size );
}
static void test_RtlFormatMessage(void)
@@ -2768,7 +2769,7 @@ static void test_RtlFormatMessage(void)
}
lstrcpyW( buffer, L"xxxxxxxxxx" );
fmt( src, 4, FALSE, FALSE, buffer, sizeof(buffer), &size );
- ok( !lstrcmpW( buffer, expect ), "%04x: got %s\n", i, debugstr_w(buffer) );
+ ok( !lstrcmpW( buffer, expect ), "%04lx: got %s\n", i, debugstr_w(buffer) );
}
/* args are not counted the same way with an argument array */
@@ -2787,37 +2788,37 @@ static void test_RtlFormatMessage(void)
/* buffer overflows */
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"testing", 0, FALSE, FALSE, buffer, 8, &size );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"testxxxxxx" ) || broken(!lstrcmpW( buffer, L"tesxxxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1", 0, FALSE, FALSE, buffer, 8, &size, L"test" );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"tes\0xxxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L"testxxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!x!", 0, FALSE, FALSE, buffer, 8, &size, 0x12345678 );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"123\0xxxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L"1234xxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!*s!", 0, FALSE, FALSE, buffer, 10, &size, 5, L"abc" );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L" ab\0xxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L" abcxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"ab%n", 0, FALSE, FALSE, buffer, 6, &size );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"abxxxxxxxx", 10 * sizeof(WCHAR) ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
/* ignore inserts */
lstrcpyW( buffer, L"xxxxxxxxxx" );
@@ -2826,67 +2827,67 @@ static void test_RtlFormatMessage(void)
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"ab%0cd", 0, TRUE, FALSE, buffer, sizeof(buffer), &size );
- ok( !status, "failed %x\n", status );
+ ok( !status, "failed %lx\n", status );
ok( !memcmp( buffer, L"ab\0xxxxxxx", 10 * sizeof(WCHAR) ), "got %s\n", wine_dbgstr_wn(buffer, 10) );
/* invalid args */
lstrcpyW( buffer, L"xxxxxxxxxx" );
size = 0xdeadbeef;
status = pRtlFormatMessage( L"abc%1", 0, FALSE, FALSE, FALSE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = pRtlFormatMessage( L"abc%1", 0, FALSE, FALSE, TRUE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = pRtlFormatMessage( L"abc%", 0, FALSE, FALSE, TRUE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!u! %2!u", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"34 xxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!**u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"*u" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!0.3+*u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"+*u" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"aa%1!***u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"aaxxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!#.000000000000000000000000000x!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abc0x22" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!#.0000000000000000000000000000x!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!hsaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, "hello" );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
}
1
0
[PATCH] dlls/ntdll/tests/rtlbitmap.c: enable compilation with long types
by Eric Pouech March 23, 2022
by Eric Pouech March 23, 2022
March 23, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtlbitmap.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/tests/rtlbitmap.c b/dlls/ntdll/tests/rtlbitmap.c
index 3c3992e8fc9..7cb046a105a 100644
--- a/dlls/ntdll/tests/rtlbitmap.c
+++ b/dlls/ntdll/tests/rtlbitmap.c
@@ -20,6 +20,7 @@
* We use function pointers here as some of the bitmap functions exist only
* in later versions of ntdll.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "ntdll_test.h"
@@ -501,7 +502,7 @@ static void test_RtlFindSetRuns(void)
/* Get first 2 */
ulCount = pRtlFindSetRuns(&bm, runs, 2, FALSE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 19 + 3,"bad size\n");
@@ -511,7 +512,7 @@ static void test_RtlFindSetRuns(void)
/* Get longest 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindSetRuns(&bm, runs, 2, TRUE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 1877,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 33 + 19,"bad size\n");
@@ -521,7 +522,7 @@ static void test_RtlFindSetRuns(void)
/* Get all 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindSetRuns(&bm, runs, 3, TRUE);
- ok(ulCount == 3, "RtlFindClearRuns returned %d, expected 3\n", ulCount);
+ ok(ulCount == 3, "RtlFindClearRuns returned %ld, expected 3\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101 ||
runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101 ||
@@ -539,7 +540,7 @@ static void test_RtlFindSetRuns(void)
ULONG ulStart = 0;
ulCount = pRtlFindLongestRunSet(&bm, &ulStart);
- ok(ulCount == 33 && ulStart == 1877,"didn't find longest %d %d\n",ulCount,ulStart);
+ ok(ulCount == 33 && ulStart == 1877,"didn't find longest %ld %ld\n",ulCount,ulStart);
memset(buff, 0, sizeof(buff));
ulCount = pRtlFindLongestRunSet(&bm, &ulStart);
@@ -578,7 +579,7 @@ static void test_RtlFindClearRuns(void)
/* Get first 2 */
ulCount = pRtlFindClearRuns(&bm, runs, 2, FALSE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 19 + 3,"bad size\n");
@@ -588,7 +589,7 @@ static void test_RtlFindClearRuns(void)
/* Get longest 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindClearRuns(&bm, runs, 2, TRUE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 1877,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 33 + 19,"bad size\n");
@@ -598,7 +599,7 @@ static void test_RtlFindClearRuns(void)
/* Get all 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindClearRuns(&bm, runs, 3, TRUE);
- ok(ulCount == 3, "RtlFindClearRuns returned %d, expected 3\n", ulCount);
+ ok(ulCount == 3, "RtlFindClearRuns returned %ld, expected 3\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101 ||
runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101 ||
@@ -635,8 +636,8 @@ static void test_RtlFindNextForwardRunSet(void)
pRtlInitializeBitMap(&bm, mask, 62);
ulCount = pRtlFindNextForwardRunSet(&bm, ulStart, &lpPos);
- ok(ulCount == 6, "Invalid length of found set run: %d, expected 6\n", ulCount);
- ok(lpPos == 56, "Invalid position of found set run: %d, expected 56\n", lpPos);
+ ok(ulCount == 6, "Invalid length of found set run: %ld, expected 6\n", ulCount);
+ ok(lpPos == 56, "Invalid position of found set run: %ld, expected 56\n", lpPos);
}
static void test_RtlFindNextForwardRunClear(void)
@@ -649,8 +650,8 @@ static void test_RtlFindNextForwardRunClear(void)
pRtlInitializeBitMap(&bm, mask, 62);
ulCount = pRtlFindNextForwardRunClear(&bm, ulStart, &lpPos);
- ok(ulCount == 6, "Invalid length of found clear run: %d, expected 6\n", ulCount);
- ok(lpPos == 56, "Invalid position of found clear run: %d, expected 56\n", lpPos);
+ ok(ulCount == 6, "Invalid length of found clear run: %ld, expected 6\n", ulCount);
+ ok(lpPos == 56, "Invalid position of found clear run: %ld, expected 56\n", lpPos);
}
#endif
1
0
March 23, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtl.c | 543 ++++++++++++++++++++++++------------------------
1 file changed, 272 insertions(+), 271 deletions(-)
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index c0168884a0a..6d7a5eb845c 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -20,6 +20,7 @@
* We use function pointers here as there is no import library for NTDLL on
* windows.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h>
@@ -141,17 +142,17 @@ static void test_RtlQueryProcessDebugInformation(void)
ok( buffer != NULL, "RtlCreateQueryDebugBuffer returned NULL" );
status = RtlQueryProcessDebugInformation( GetCurrentThreadId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
- ok( status == STATUS_INVALID_CID, "RtlQueryProcessDebugInformation returned %x\n", status );
+ ok( status == STATUS_INVALID_CID, "RtlQueryProcessDebugInformation returned %lx\n", status );
status = RtlQueryProcessDebugInformation( GetCurrentProcessId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
- ok( !status, "RtlQueryProcessDebugInformation returned %x\n", status );
+ ok( !status, "RtlQueryProcessDebugInformation returned %lx\n", status );
status = RtlDestroyQueryDebugBuffer( buffer );
- ok( !status, "RtlDestroyQueryDebugBuffer returned %x\n", status );
+ ok( !status, "RtlDestroyQueryDebugBuffer returned %lx\n", status );
}
#define COMP(str1,str2,cmplen,len) size = RtlCompareMemory(str1, str2, cmplen); \
- ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len)
+ ok(size == len, "Expected %Id, got %Id\n", size, (SIZE_T)len)
static void test_RtlCompareMemory(void)
{
@@ -175,39 +176,39 @@ static void test_RtlCompareMemoryUlong(void)
a[2]= 0x89ab;
a[3]= 0xcdef;
result = RtlCompareMemoryUlong(a, 0, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 0, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 0, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 3, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 5, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 7, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 8, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 9, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0127);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x0127) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x0127) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x7123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x7123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x7123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 16, 0x4567);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 16, 0x4567) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 16, 0x4567) returns %lu, expected 0\n", a, result);
a[1]= 0x0123;
result = RtlCompareMemoryUlong(a, 3, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 5, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 7, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 8, 0x0123);
- ok(result == 8, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %u, expected 8\n", a, result);
+ ok(result == 8, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %lu, expected 8\n", a, result);
result = RtlCompareMemoryUlong(a, 9, 0x0123);
- ok(result == 8, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %u, expected 8\n", a, result);
+ ok(result == 8, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %lu, expected 8\n", a, result);
}
#define COPY(len) memset(dest,0,sizeof(dest_aligned_block)); pRtlMoveMemory(dest, src, len)
@@ -364,7 +365,7 @@ static void test_RtlUniform(void)
expected = 0x7fffffc3;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0)) returns %lx, expected %lx\n",
result, expected);
/*
* The algorithm is now:
@@ -385,7 +386,7 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + 1;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 1)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 1)) returns %lx, expected %lx\n",
result, expected);
/*
* For seed = 2 the const_2 is 0x7fffffc3:
@@ -405,7 +406,7 @@ static void test_RtlUniform(void)
}
ok(result == expected,
- "RtlUniform(&seed (seed == 2)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 2)) returns %lx, expected %lx\n",
result, expected);
/*
@@ -415,21 +416,21 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + (seed & 1);
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 3)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 3)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1aa;
expected = seed * 0xffffffed + 0x7fffffc3;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1aa)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1aa)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1ab;
expected = seed * 0xffffffed + 0x7fffffc3 + 1;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ab)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ab)) returns %lx, expected %lx\n",
result, expected);
/*
* When seed is 0x6bca1ac there is an exception:
@@ -438,7 +439,7 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + 2;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ac)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ac)) returns %lx, expected %lx\n",
result, expected);
/*
* Note that up to here const_3 is not used
@@ -450,14 +451,14 @@ static void test_RtlUniform(void)
expected = (seed * 0xffffffed + 0x7fffffc3) & MAXLONG;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ad)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ad)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1ae;
expected = (seed * 0xffffffed + 0x7fffffc3 + 1) & MAXLONG;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ae)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ae)) returns %lx, expected %lx\n",
result, expected);
/*
* There are several ranges where for odd or even seed the result must be
@@ -565,10 +566,10 @@ static void test_RtlUniform(void)
seed_bak = seed;
result = RtlUniform(&seed);
ok(result == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) returns %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
ok(seed == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) sets seed to %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
} /* for */
/*
@@ -612,10 +613,10 @@ static void test_RtlUniform(void)
seed_bak = seed;
result = RtlUniform(&seed);
ok(result == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) returns %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
ok(seed == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) sets seed to %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
} /* for */
/*
@@ -636,9 +637,9 @@ static void test_RtlRandom(void)
for (i = 0; i < ARRAY_SIZE(res); i++)
{
res[i] = RtlRandom(&seed);
- ok(seed != res[i], "%i: seed is same as res %x\n", i, seed);
+ ok(seed != res[i], "%i: seed is same as res %lx\n", i, seed);
for (j = 0; j < i; j++)
- ok(res[i] != res[j], "res[%i] (%x) is same as res[%i] (%x)\n", j, res[j], i, res[i]);
+ ok(res[i] != res[j], "res[%i] (%lx) is same as res[%i] (%lx)\n", j, res[j], i, res[i]);
}
}
@@ -672,7 +673,7 @@ static void test_RtlAreAllAccessesGranted(void)
result = RtlAreAllAccessesGranted(all_accesses[test_num].GrantedAccess,
all_accesses[test_num].DesiredAccess);
ok(all_accesses[test_num].result == result,
- "(test %d): RtlAreAllAccessesGranted(%08x, %08x) returns %d, expected %d\n",
+ "(test %d): RtlAreAllAccessesGranted(%08lx, %08lx) returns %d, expected %d\n",
test_num, all_accesses[test_num].GrantedAccess,
all_accesses[test_num].DesiredAccess,
result, all_accesses[test_num].result);
@@ -708,7 +709,7 @@ static void test_RtlAreAnyAccessesGranted(void)
result = RtlAreAnyAccessesGranted(any_accesses[test_num].GrantedAccess,
any_accesses[test_num].DesiredAccess);
ok(any_accesses[test_num].result == result,
- "(test %d): RtlAreAnyAccessesGranted(%08x, %08x) returns %d, expected %d\n",
+ "(test %d): RtlAreAnyAccessesGranted(%08lx, %08lx) returns %d, expected %d\n",
test_num, any_accesses[test_num].GrantedAccess,
any_accesses[test_num].DesiredAccess,
result, any_accesses[test_num].result);
@@ -720,7 +721,7 @@ static void test_RtlComputeCrc32(void)
DWORD crc = 0;
crc = RtlComputeCrc32(crc, (const BYTE *)src, LEN);
- ok(crc == 0x40861dc2,"Expected 0x40861dc2, got %8x\n", crc);
+ ok(crc == 0x40861dc2,"Expected 0x40861dc2, got %8lx\n", crc);
}
@@ -754,7 +755,7 @@ static void test_HandleTables(void)
result = RtlFreeHandle(&HandleTable, &MyHandle->RtlHandle);
ok(result, "Couldn't free handle %p\n", MyHandle);
status = RtlDestroyHandleTable(&HandleTable);
- ok(status == STATUS_SUCCESS, "RtlDestroyHandleTable failed with error 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "RtlDestroyHandleTable failed with error 0x%08lx\n", status);
}
static void test_RtlAllocateAndInitializeSid(void)
@@ -764,9 +765,9 @@ static void test_RtlAllocateAndInitializeSid(void)
PSID psid;
ret = RtlAllocateAndInitializeSid(&sia, 0, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
- ok(!ret, "RtlAllocateAndInitializeSid error %08x\n", ret);
+ ok(!ret, "RtlAllocateAndInitializeSid error %08lx\n", ret);
ret = RtlFreeSid(psid);
- ok(!ret, "RtlFreeSid error %08x\n", ret);
+ ok(!ret, "RtlFreeSid error %08lx\n", ret);
/* these tests crash on XP */
if (0)
@@ -776,7 +777,7 @@ static void test_RtlAllocateAndInitializeSid(void)
}
ret = RtlAllocateAndInitializeSid(&sia, 9, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
- ok(ret == STATUS_INVALID_SID, "wrong error %08x\n", ret);
+ ok(ret == STATUS_INVALID_SID, "wrong error %08lx\n", ret);
}
static void test_RtlDeleteTimer(void)
@@ -786,7 +787,7 @@ static void test_RtlDeleteTimer(void)
ret = RtlDeleteTimer(NULL, NULL, NULL);
ok(ret == STATUS_INVALID_PARAMETER_1 ||
ret == STATUS_INVALID_PARAMETER, /* W2K */
- "expected STATUS_INVALID_PARAMETER_1 or STATUS_INVALID_PARAMETER, got %x\n", ret);
+ "expected STATUS_INVALID_PARAMETER_1 or STATUS_INVALID_PARAMETER, got %lx\n", ret);
}
static void test_RtlThreadErrorMode(void)
@@ -810,32 +811,32 @@ static void test_RtlThreadErrorMode(void)
status = pRtlSetThreadErrorMode(0x70, &mode);
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode failed with error 0x%08x\n", status);
+ "RtlSetThreadErrorMode failed with error 0x%08lx\n", status);
ok(mode == oldmode,
- "RtlSetThreadErrorMode returned mode 0x%x, expected 0x%x\n",
+ "RtlSetThreadErrorMode returned mode 0x%lx, expected 0x%lx\n",
mode, oldmode);
ok(pRtlGetThreadErrorMode() == 0x70,
- "RtlGetThreadErrorMode returned 0x%x, expected 0x%x\n", mode, 0x70);
+ "RtlGetThreadErrorMode returned 0x%lx, expected 0x%x\n", mode, 0x70);
if (!is_wow64)
{
ok(NtCurrentTeb()->HardErrorDisabled == 0x70,
- "The TEB contains 0x%x, expected 0x%x\n",
+ "The TEB contains 0x%lx, expected 0x%x\n",
NtCurrentTeb()->HardErrorDisabled, 0x70);
}
status = pRtlSetThreadErrorMode(0, &mode);
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode failed with error 0x%08x\n", status);
+ "RtlSetThreadErrorMode failed with error 0x%08lx\n", status);
ok(mode == 0x70,
- "RtlSetThreadErrorMode returned mode 0x%x, expected 0x%x\n",
+ "RtlSetThreadErrorMode returned mode 0x%lx, expected 0x%x\n",
mode, 0x70);
ok(pRtlGetThreadErrorMode() == 0,
- "RtlGetThreadErrorMode returned 0x%x, expected 0x%x\n", mode, 0);
+ "RtlGetThreadErrorMode returned 0x%lx, expected 0x%x\n", mode, 0);
if (!is_wow64)
{
ok(NtCurrentTeb()->HardErrorDisabled == 0,
- "The TEB contains 0x%x, expected 0x%x\n",
+ "The TEB contains 0x%lx, expected 0x%x\n",
NtCurrentTeb()->HardErrorDisabled, 0);
}
@@ -845,11 +846,11 @@ static void test_RtlThreadErrorMode(void)
if (mode & 0x70)
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode(%x,NULL) failed with error 0x%08x\n",
+ "RtlSetThreadErrorMode(%lx,NULL) failed with error 0x%08lx\n",
mode, status);
else
ok(status == STATUS_INVALID_PARAMETER_1,
- "RtlSetThreadErrorMode(%x,NULL) returns 0x%08x, "
+ "RtlSetThreadErrorMode(%lx,NULL) returns 0x%08lx, "
"expected STATUS_INVALID_PARAMETER_1\n",
mode, status);
}
@@ -868,7 +869,7 @@ static void test_LdrProcessRelocationBlock(void)
reloc = IMAGE_REL_BASED_HIGHLOW<<12;
ret = LdrProcessRelocationBlock(&addr32, 1, &reloc, 0x500050);
ok((USHORT*)ret == &reloc+1, "ret = %p, expected %p\n", ret, &reloc+1);
- ok(addr32 == 0x550055, "addr32 = %x, expected 0x550055\n", addr32);
+ ok(addr32 == 0x550055, "addr32 = %lx, expected 0x550055\n", addr32);
addr16 = 0x505;
reloc = IMAGE_REL_BASED_HIGH<<12;
@@ -954,7 +955,7 @@ static void test_RtlIpv4AddressToStringEx(void)
used = strlen(buffer);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used + 1;
memset(buffer, '#', sizeof(buffer) - 1);
@@ -962,14 +963,14 @@ static void test_RtlIpv4AddressToStringEx(void)
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used;
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
size = used - 1;
@@ -977,7 +978,7 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
@@ -992,7 +993,7 @@ static void test_RtlIpv4AddressToStringEx(void)
used = strlen(buffer);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used + 1;
memset(buffer, '#', sizeof(buffer) - 1);
@@ -1000,14 +1001,14 @@ static void test_RtlIpv4AddressToStringEx(void)
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used;
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
size = used - 1;
@@ -1015,7 +1016,7 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
@@ -1024,19 +1025,19 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, 0, buffer, NULL);
ok(res == STATUS_INVALID_PARAMETER,
- "got 0x%x with '%s' (expected STATUS_INVALID_PARAMETER)\n", res, buffer);
+ "got 0x%lx with '%s' (expected STATUS_INVALID_PARAMETER)\n", res, buffer);
size = sizeof(buffer);
res = pRtlIpv4AddressToStringExA(&ip, 0, NULL, &size);
ok( res == STATUS_INVALID_PARAMETER,
- "got 0x%x and size %d (expected STATUS_INVALID_PARAMETER)\n", res, size);
+ "got 0x%lx and size %ld (expected STATUS_INVALID_PARAMETER)\n", res, size);
size = sizeof(buffer);
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(NULL, 0, buffer, &size);
ok( res == STATUS_INVALID_PARAMETER,
- "got 0x%x and size %d with '%s' (expected STATUS_INVALID_PARAMETER)\n",
+ "got 0x%lx and size %ld with '%s' (expected STATUS_INVALID_PARAMETER)\n",
res, size, buffer);
}
@@ -1193,7 +1194,7 @@ static void test_RtlIpv4StringToAddress(void)
ip.S_un.S_addr = 0xabababab;
res = RtlIpv4StringToAddressA(ipv4_tests[i].address, FALSE, &terminator, &ip);
ok(res == ipv4_tests[i].res,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, ipv4_tests[i].res);
ok(terminator == ipv4_tests[i].address + ipv4_tests[i].terminator_offset,
"[%s] terminator = %p, expected %p\n",
@@ -1201,7 +1202,7 @@ static void test_RtlIpv4StringToAddress(void)
init_ip4(&expected_ip, ipv4_tests[i].ip);
ok(ip.S_un.S_addr == expected_ip.S_un.S_addr,
- "[%s] ip = %08x, expected %08x\n",
+ "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
if (!(ipv4_tests[i].flags & strict_diff_4))
@@ -1218,7 +1219,7 @@ static void test_RtlIpv4StringToAddress(void)
ip.S_un.S_addr = 0xabababab;
res = RtlIpv4StringToAddressA(ipv4_tests[i].address, TRUE, &terminator, &ip);
ok(res == ipv4_tests[i].res_strict,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, ipv4_tests[i].res_strict);
ok(terminator == ipv4_tests[i].address + ipv4_tests[i].terminator_offset_strict,
"[%s] terminator = %p, expected %p\n",
@@ -1226,7 +1227,7 @@ static void test_RtlIpv4StringToAddress(void)
init_ip4(&expected_ip, ipv4_tests[i].ip_strict);
ok(ip.S_un.S_addr == expected_ip.S_un.S_addr,
- "[%s] ip = %08x, expected %08x\n",
+ "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
}
}
@@ -1276,23 +1277,23 @@ static void test_RtlIpv4StringToAddressEx(void)
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA(NULL, FALSE, &ip, &port);
- ok(res == STATUS_INVALID_PARAMETER, "[null address] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null address] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
- ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %x\n", ip.S_un.S_addr);
+ ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %lx\n", ip.S_un.S_addr);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
port = 0xdead;
res = pRtlIpv4StringToAddressExA("1.1.1.1", FALSE, NULL, &port);
- ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA("1.1.1.1", FALSE, &ip, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null port] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null port] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
- ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %x\n", ip.S_un.S_addr);
+ ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %lx\n", ip.S_un.S_addr);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
/* first we run the non-ex testcases on the ex function */
@@ -1304,11 +1305,11 @@ static void test_RtlIpv4StringToAddressEx(void)
port = 0xdead;
ip.S_un.S_addr = 0xabababab;
res = pRtlIpv4StringToAddressExA(ipv4_tests[i].address, FALSE, &ip, &port);
- ok(res == expect_res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, expect_res);
init_ip4(&expected_ip, ipv4_tests[i].ip);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
if (!(ipv4_tests[i].flags & strict_diff_4))
@@ -1325,11 +1326,11 @@ static void test_RtlIpv4StringToAddressEx(void)
port = 0xdead;
ip.S_un.S_addr = 0xabababab;
res = pRtlIpv4StringToAddressExA(ipv4_tests[i].address, TRUE, &ip, &port);
- ok(res == expect_res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, expect_res);
init_ip4(&expected_ip, ipv4_tests[i].ip_strict);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
}
@@ -1342,11 +1343,11 @@ static void test_RtlIpv4StringToAddressEx(void)
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA(ipv4_ex_tests[i].address, strict, &ip, &port);
- ok(res == ipv4_ex_tests[i].res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == ipv4_ex_tests[i].res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_ex_tests[i].address, res, ipv4_ex_tests[i].res);
init_ip4(&expected_ip, ipv4_ex_tests[i].ip);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_ex_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
ok(port == ipv4_ex_tests[i].port, "[%s] port = %u, expected %u\n",
ipv4_ex_tests[i].address, port, ipv4_ex_tests[i].port);
@@ -1925,31 +1926,31 @@ static void test_RtlIpv6AddressToStringEx(void)
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, &len);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
ok(len == 3 && !strcmp(buffer, "::"),
- "got len %d with '%s' (expected 3 with '::')\n", len, buffer);
+ "got len %ld with '%s' (expected 3 with '::')\n", len, buffer);
memset(buffer, '#', sizeof(buffer));
buffer[sizeof(buffer)-1] = 0;
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(NULL, 0, 0, buffer, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, NULL, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null buffer] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null buffer] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
len = 2;
memset(buffer, '#', sizeof(buffer));
buffer[sizeof(buffer)-1] = 0;
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
ok(buffer[0] == '#', "got first char %c (expected '#')\n", buffer[0]);
- ok(len == 3, "got len %d (expected len 3)\n", len);
+ ok(len == 3, "got len %ld (expected len 3)\n", len);
for (i = 0; i < ARRAY_SIZE(tests); i++)
{
@@ -1960,9 +1961,9 @@ static void test_RtlIpv6AddressToStringEx(void)
res = pRtlIpv6AddressToStringExA(&ip, tests[i].scopeid, tests[i].port, buffer, &len);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
ok(len == (strlen(tests[i].address) + 1) && !strcmp(buffer, tests[i].address),
- "got len %d with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address);
+ "got len %ld with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address);
}
}
@@ -1979,7 +1980,7 @@ static void compare_RtlIpv6StringToAddressW(PCSTR name_a, int terminator_offset_
init_ip6(&ip, NULL);
terminator = (void *)0xdeadbeef;
res = RtlIpv6StringToAddressW(name, &terminator, &ip);
- ok(res == res_a, "[W:%s] res = 0x%08x, expected 0x%08x\n", name_a, res, res_a);
+ ok(res == res_a, "[W:%s] res = 0x%08lx, expected 0x%08lx\n", name_a, res, res_a);
if (terminator_offset_a < 0)
{
@@ -2011,16 +2012,16 @@ static void test_RtlIpv6StringToAddress(void)
unsigned int i;
res = RtlIpv6StringToAddressA("::", &terminator, &ip);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
if (0)
{
/* any of these crash */
res = RtlIpv6StringToAddressA(NULL, &terminator, &ip);
- ok(res == STATUS_INVALID_PARAMETER, "[null string] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null string] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = RtlIpv6StringToAddressA("::", NULL, &ip);
- ok(res == STATUS_INVALID_PARAMETER, "[null terminator] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null terminator] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = RtlIpv6StringToAddressA("::", &terminator, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null result] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null result] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
}
/* sanity check */
@@ -2037,7 +2038,7 @@ static void test_RtlIpv6StringToAddress(void)
if (ipv6_tests[i].flags & win_broken_6)
{
ok(res == ipv6_tests[i].res || broken(res == STATUS_INVALID_PARAMETER),
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, ipv6_tests[i].res);
if (res == STATUS_INVALID_PARAMETER)
@@ -2046,7 +2047,7 @@ static void test_RtlIpv6StringToAddress(void)
else
{
ok(res == ipv6_tests[i].res,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, ipv6_tests[i].res);
}
@@ -2090,8 +2091,8 @@ static void compare_RtlIpv6StringToAddressExW(PCSTR name_a, const struct in6_add
init_ip6(&ip, NULL);
res = pRtlIpv6StringToAddressExW(name, &ip, &scope, &port);
- ok(res == res_a, "[W:%s] res = 0x%08x, expected 0x%08x\n", name_a, res, res_a);
- ok(scope == scope_a, "[W:%s] scope = 0x%08x, expected 0x%08x\n", name_a, scope, scope_a);
+ ok(res == res_a, "[W:%s] res = 0x%08lx, expected 0x%08lx\n", name_a, res, res_a);
+ ok(scope == scope_a, "[W:%s] scope = 0x%08lx, expected 0x%08lx\n", name_a, scope, scope_a);
ok(port == port_a, "[W:%s] port = 0x%08x, expected 0x%08x\n", name_a, port, port_a);
ok(!memcmp(&ip, addr_a, sizeof(ip)),
@@ -2199,7 +2200,7 @@ static void test_RtlIpv6StringToAddressEx(void)
}
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, &scope, &port);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
init_ip6(&ip, NULL);
init_ip6(&expected_ip, NULL);
@@ -2207,8 +2208,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(NULL, &ip, &scope, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null string] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null string] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null string] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null string] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null string] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null string] ip is changed, expected it not to change\n");
@@ -2219,8 +2220,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, NULL, &scope, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null result] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null result] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null result] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null result] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null result] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null result] ip is changed, expected it not to change\n");
@@ -2230,8 +2231,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, NULL, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null scope] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null scope] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null scope] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null scope] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null scope] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null scope] ip is changed, expected it not to change\n");
@@ -2241,8 +2242,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, &scope, NULL);
ok(res == STATUS_INVALID_PARAMETER,
- "[null port] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null port] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null port] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null port] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null port] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null port] ip is changed, expected it not to change\n");
@@ -2267,14 +2268,14 @@ static void test_RtlIpv6StringToAddressEx(void)
/* make sure nothing was changed if this function fails. */
if (res == STATUS_INVALID_PARAMETER)
{
- ok(scope == 0xbadf00d, "[%s] scope = 0x%08x, expected 0xbadf00d\n",
+ ok(scope == 0xbadf00d, "[%s] scope = 0x%08lx, expected 0xbadf00d\n",
ipv6_tests[i].address, scope);
ok(port == 0xbeef, "[%s] port = 0x%08x, expected 0xbeef\n",
ipv6_tests[i].address, port);
}
else
{
- ok(scope != 0xbadf00d, "[%s] scope = 0x%08x, not expected 0xbadf00d\n",
+ ok(scope != 0xbadf00d, "[%s] scope = 0x%08lx, not expected 0xbadf00d\n",
ipv6_tests[i].address, scope);
ok(port != 0xbeef, "[%s] port = 0x%08x, not expected 0xbeef\n",
ipv6_tests[i].address, port);
@@ -2283,14 +2284,14 @@ static void test_RtlIpv6StringToAddressEx(void)
if (ipv6_tests[i].flags & win_broken_6)
{
ok(res == expect_ret || broken(res == STATUS_INVALID_PARAMETER),
- "[%s] res = 0x%08x, expected 0x%08x\n", ipv6_tests[i].address, res, expect_ret);
+ "[%s] res = 0x%08lx, expected 0x%08lx\n", ipv6_tests[i].address, res, expect_ret);
if (res == STATUS_INVALID_PARAMETER)
continue;
}
else
{
- ok(res == expect_ret, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_ret, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, expect_ret);
}
@@ -2318,9 +2319,9 @@ static void test_RtlIpv6StringToAddressEx(void)
res = pRtlIpv6StringToAddressExA(ipv6_ex_tests[i].address, &ip, &scope, &port);
compare_RtlIpv6StringToAddressExW(ipv6_ex_tests[i].address, &ip, res, scope, port);
- ok(res == ipv6_ex_tests[i].res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == ipv6_ex_tests[i].res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_ex_tests[i].address, res, ipv6_ex_tests[i].res);
- ok(scope == ipv6_ex_tests[i].scope, "[%s] scope = 0x%08x, expected 0x%08x\n",
+ ok(scope == ipv6_ex_tests[i].scope, "[%s] scope = 0x%08lx, expected 0x%08lx\n",
ipv6_ex_tests[i].address, scope, ipv6_ex_tests[i].scope);
ok(port == ipv6_ex_tests[i].port, "[%s] port = 0x%08x, expected 0x%08x\n",
ipv6_ex_tests[i].address, port, ipv6_ex_tests[i].port);
@@ -2354,7 +2355,7 @@ static void test_LdrAddRefDll(void)
mod = LoadLibraryA("comctl32.dll");
ok(mod != NULL, "got %p\n", mod);
status = LdrAddRefDll(0, mod);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
ret = FreeLibrary(mod);
ok(ret, "got %d\n", ret);
@@ -2370,7 +2371,7 @@ static void test_LdrAddRefDll(void)
mod = LoadLibraryA("comctl32.dll");
ok(mod != NULL, "got %p\n", mod);
status = LdrAddRefDll(LDR_ADDREF_DLL_PIN, mod);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
ret = FreeLibrary(mod);
ok(ret, "got %d\n", ret);
@@ -2395,39 +2396,39 @@ static void test_LdrLockLoaderLock(void)
result = 10;
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x10, &result, &magic);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
+ ok(magic == 0, "got %Ix\n", magic);
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x10, NULL, &magic);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(magic == 0, "got %Ix\n", magic);
result = 10;
status = LdrLockLoaderLock(0x10, &result, NULL);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
/* non-blocking mode, result is null */
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x2, NULL, &magic);
- ok(status == STATUS_INVALID_PARAMETER_2, "got 0x%08x\n", status);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_2, "got 0x%08lx\n", status);
+ ok(magic == 0, "got %Ix\n", magic);
/* magic pointer is null */
result = 10;
status = LdrLockLoaderLock(0, &result, NULL);
- ok(status == STATUS_INVALID_PARAMETER_3, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
+ ok(status == STATUS_INVALID_PARAMETER_3, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
/* lock in non-blocking mode */
result = 0;
magic = 0;
status = LdrLockLoaderLock(0x2, &result, &magic);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
- ok(result == 1, "got %d\n", result);
- ok(magic != 0, "got %lx\n", magic);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
+ ok(result == 1, "got %ld\n", result);
+ ok(magic != 0, "got %Ix\n", magic);
LdrUnlockLoaderLock(0, magic);
}
@@ -2443,39 +2444,39 @@ static void test_RtlCompressBuffer(void)
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
workspace = HeapAlloc(GetProcessHeap(), 0, compress_workspace);
- ok(workspace != NULL, "HeapAlloc failed %d\n", GetLastError());
+ ok(workspace != NULL, "HeapAlloc failed %ld\n", GetLastError());
/* test compression format / engine */
final_size = 0xdeadbeef;
status = RtlCompressBuffer(COMPRESSION_FORMAT_NONE, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlCompressBuffer(COMPRESSION_FORMAT_DEFAULT, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlCompressBuffer(0xFF, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
/* test compression */
final_size = 0xdeadbeef;
memset(buf1, 0x11, sizeof(buf1));
status = RtlCompressBuffer(COMPRESSION_FORMAT_LZNT1, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1), 4096, &final_size, workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
ok((*(WORD *)buf1 & 0x7000) == 0x3000, "no chunk signature found %04x\n", *(WORD *)buf1);
todo_wine
- ok(final_size < sizeof(test_buffer), "got wrong final_size %u\n", final_size);
+ ok(final_size < sizeof(test_buffer), "got wrong final_size %lu\n", final_size);
/* test decompression */
buf_size = final_size;
@@ -2483,8 +2484,8 @@ static void test_RtlCompressBuffer(void)
memset(buf2, 0x11, sizeof(buf2));
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf2, sizeof(buf2),
buf1, buf_size, &final_size);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(final_size == sizeof(test_buffer), "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(final_size == sizeof(test_buffer), "got wrong final_size %lu\n", final_size);
ok(!memcmp(buf2, test_buffer, sizeof(test_buffer)), "got wrong decoded data\n");
ok(buf2[sizeof(test_buffer)] == 0x11, "too many bytes written\n");
@@ -2493,7 +2494,7 @@ static void test_RtlCompressBuffer(void)
memset(buf1, 0x11, sizeof(buf1));
status = RtlCompressBuffer(COMPRESSION_FORMAT_LZNT1, test_buffer, sizeof(test_buffer),
buf1, 4, 4096, &final_size, workspace);
- ok(status == STATUS_BUFFER_TOO_SMALL, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "got wrong status 0x%08lx\n", status);
HeapFree(GetProcessHeap(), 0, workspace);
}
@@ -2506,29 +2507,29 @@ static void test_RtlGetCompressionWorkSpaceSize(void)
/* test invalid format / engine */
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_NONE, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_DEFAULT, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
status = RtlGetCompressionWorkSpaceSize(0xFF, &compress_workspace, &decompress_workspace);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
/* test LZNT1 with normal and maximum compression */
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
- ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
+ ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %lu\n", decompress_workspace);
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM,
&compress_workspace, &decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
- ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
+ ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %lu\n", decompress_workspace);
}
/* helper for test_RtlDecompressBuffer, checks if a chunk is incomplete */
@@ -2769,25 +2770,25 @@ static void test_RtlDecompressBuffer(void)
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(COMPRESSION_FORMAT_NONE, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(COMPRESSION_FORMAT_DEFAULT, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(0xFF, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
/* regular tests for RtlDecompressBuffer */
for (i = 0; i < ARRAY_SIZE(test_lznt); i++)
{
- trace("Running test %d (compressed_size=%u, uncompressed_size=%u, status=0x%08x)\n",
+ trace("Running test %d (compressed_size=%lu, uncompressed_size=%lu, status=0x%08lx)\n",
i, test_lznt[i].compressed_size, test_lznt[i].uncompressed_size, test_lznt[i].status);
/* test with very big buffer */
@@ -2796,15 +2797,15 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
test_lznt[i].compressed_size, &final_size);
ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
- (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test that modifier for compression engine is ignored */
@@ -2813,15 +2814,15 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM, buf, sizeof(buf),
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
- (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test with expected output size */
@@ -2831,15 +2832,15 @@ static void test_RtlDecompressBuffer(void)
memset(buf, 0x11, sizeof(buf));
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, test_lznt[i].uncompressed_size,
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
}
@@ -2852,17 +2853,17 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_TRUNCATED)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size - 1,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size - 1),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size - 1);
}
}
@@ -2872,11 +2873,11 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, 0, test_lznt[i].compressed,
test_lznt[i].compressed_size, &final_size);
if (is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, FALSE))
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
{
- ok(status == STATUS_SUCCESS, "%d: got wrong status 0x%08x\n", i, status);
- ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(status == STATUS_SUCCESS, "%d: got wrong status 0x%08lx\n", i, status);
+ ok(final_size == 0, "%d: got wrong final_size %lu\n", i, final_size);
ok(buf[0] == 0x11, "%d: buf[0] was modified\n", i);
}
@@ -2887,17 +2888,17 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 0, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test RtlDecompressFragment with offset = 1 */
@@ -2907,26 +2908,26 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 1, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
if (test_lznt[i].uncompressed_size == 0)
{
todo_wine
- ok(final_size == 4095, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 4095, "%d: got wrong final_size %lu\n", i, final_size);
/* Buffer doesn't contain any useful value on Windows */
ok(buf[4095] == 0x11, "%d: buf[4095] was modified\n", i);
}
else
{
ok(final_size == test_lznt[i].uncompressed_size - 1,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed + 1, test_lznt[i].uncompressed_size - 1),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size - 1);
}
}
@@ -2937,13 +2938,13 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 4095, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
todo_wine
- ok(final_size == 1, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 1, "%d: got wrong final_size %lu\n", i, final_size);
todo_wine
ok(buf[0] == 0, "%d: padding is not zero\n", i);
ok(buf[1] == 0x11, "%d: buf[1] was modified\n", i);
@@ -2956,10 +2957,10 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 4096, &final_size, workspace);
expected_status = is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, TRUE) ?
test_lznt[i].status : STATUS_SUCCESS;
- ok(status == expected_status, "%d: got wrong status 0x%08x, expected 0x%08x\n", i, status, expected_status);
+ ok(status == expected_status, "%d: got wrong status 0x%08lx, expected 0x%08lx\n", i, status, expected_status);
if (!status)
{
- ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 0, "%d: got wrong final_size %lu\n", i, final_size);
ok(buf[0] == 0x11, "%d: buf[4096] was modified\n", i);
}
}
@@ -2980,29 +2981,29 @@ static DWORD WINAPI critsect_locked_thread(void *param)
DWORD ret;
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
ReleaseSemaphore(info->semaphores[0], 1, NULL);
ret = WaitForSingleObject(info->semaphores[1], 1000);
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
+ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", ret);
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
EnterCriticalSection(&info->crit);
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ReleaseSemaphore(info->semaphores[0], 1, NULL);
ret = WaitForSingleObject(info->semaphores[1], 1000);
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
+ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", ret);
LeaveCriticalSection(&info->crit);
return 0;
@@ -3022,9 +3023,9 @@ static void test_RtlIsCriticalSectionLocked(void)
InitializeCriticalSection(&info.crit);
info.semaphores[0] = CreateSemaphoreW(NULL, 0, 1, NULL);
- ok(info.semaphores[0] != NULL, "CreateSemaphore failed with %u\n", GetLastError());
+ ok(info.semaphores[0] != NULL, "CreateSemaphore failed with %lu\n", GetLastError());
info.semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL);
- ok(info.semaphores[1] != NULL, "CreateSemaphore failed with %u\n", GetLastError());
+ ok(info.semaphores[1] != NULL, "CreateSemaphore failed with %lu\n", GetLastError());
ret = pRtlIsCriticalSectionLocked(&info.crit);
ok(ret == FALSE, "expected FALSE, got %u\n", ret);
@@ -3039,7 +3040,7 @@ static void test_RtlIsCriticalSectionLocked(void)
ok(ret == TRUE, "expected TRUE, got %u\n", ret);
thread = CreateThread(NULL, 0, critsect_locked_thread, &info, 0, NULL);
- ok(thread != NULL, "CreateThread failed with %u\n", GetLastError());
+ ok(thread != NULL, "CreateThread failed with %lu\n", GetLastError());
ret = WaitForSingleObject(info.semaphores[0], 1000);
ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
@@ -3079,21 +3080,21 @@ static void test_RtlInitializeCriticalSectionEx(void)
pRtlInitializeCriticalSectionEx(&cs, 0, 0);
ok((cs.DebugInfo != NULL && cs.DebugInfo != no_debug) || broken(cs.DebugInfo == no_debug) /* >= Win 8 */,
"expected DebugInfo != NULL and DebugInfo != ~0, got %p\n", cs.DebugInfo);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore);
ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */,
- "expected SpinCount == 0, got %ld\n", cs.SpinCount);
+ "expected SpinCount == 0, got %Id\n", cs.SpinCount);
RtlDeleteCriticalSection(&cs);
memset(&cs, 0x11, sizeof(cs));
pRtlInitializeCriticalSectionEx(&cs, 0, RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO);
ok(cs.DebugInfo == no_debug, "expected DebugInfo == ~0, got %p\n", cs.DebugInfo);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore);
ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */,
- "expected SpinCount == 0, got %ld\n", cs.SpinCount);
+ "expected SpinCount == 0, got %Id\n", cs.SpinCount);
RtlDeleteCriticalSection(&cs);
}
@@ -3106,19 +3107,19 @@ static void test_RtlLeaveCriticalSection(void)
return; /* Skip winxp */
status = RtlInitializeCriticalSection(&cs);
- ok(!status, "RtlInitializeCriticalSection failed: %x\n", status);
+ ok(!status, "RtlInitializeCriticalSection failed: %lx\n", status);
status = RtlEnterCriticalSection(&cs);
- ok(!status, "RtlEnterCriticalSection failed: %x\n", status);
+ ok(!status, "RtlEnterCriticalSection failed: %lx\n", status);
todo_wine
- ok(cs.LockCount == -2, "expected LockCount == -2, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -2, "expected LockCount == -2, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %ld\n", cs.RecursionCount);
ok(cs.OwningThread == ULongToHandle(GetCurrentThreadId()), "unexpected OwningThread\n");
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/*
@@ -3126,34 +3127,34 @@ static void test_RtlLeaveCriticalSection(void)
* but doesn't modify LockCount so that an attempt to enter the section later will work.
*/
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == -1, "expected RecursionCount == -1, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == -1, "expected RecursionCount == -1, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/* and again */
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == -2, "expected RecursionCount == -2, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == -2, "expected RecursionCount == -2, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/* entering section fixes RecursionCount */
status = RtlEnterCriticalSection(&cs);
- ok(!status, "RtlEnterCriticalSection failed: %x\n", status);
+ ok(!status, "RtlEnterCriticalSection failed: %lx\n", status);
todo_wine
- ok(cs.LockCount == -2, "expected LockCount == -2, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -2, "expected LockCount == -2, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %ld\n", cs.RecursionCount);
ok(cs.OwningThread == ULongToHandle(GetCurrentThreadId()), "unexpected OwningThread\n");
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
status = RtlDeleteCriticalSection(&cs);
- ok(!status, "RtlDeleteCriticalSection failed: %x\n", status);
+ ok(!status, "RtlDeleteCriticalSection failed: %lx\n", status);
}
struct ldr_enum_context
@@ -3190,24 +3191,24 @@ static void test_LdrEnumerateLoadedModules(void)
ctx.found = FALSE;
ctx.count = 0;
status = pLdrEnumerateLoadedModules(NULL, ldr_enum_callback, &ctx);
- ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08x\n", status);
+ ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08lx\n", status);
ok(ctx.count > 1, "Expected more than one module, got %d\n", ctx.count);
ok(ctx.found, "Could not find ntdll in list of modules\n");
ctx.abort = TRUE;
ctx.count = 0;
status = pLdrEnumerateLoadedModules(NULL, ldr_enum_callback, &ctx);
- ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08x\n", status);
+ ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08lx\n", status);
ok(ctx.count == 1, "Expected exactly one module, got %d\n", ctx.count);
status = pLdrEnumerateLoadedModules((void *)0x1, ldr_enum_callback, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
status = pLdrEnumerateLoadedModules((void *)0xdeadbeef, ldr_enum_callback, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
status = pLdrEnumerateLoadedModules(NULL, NULL, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
}
static void test_RtlMakeSelfRelativeSD(void)
@@ -3223,31 +3224,31 @@ static void test_RtlMakeSelfRelativeSD(void)
len = 0;
status = RtlMakeSelfRelativeSD( &sd, NULL, &len );
- ok( status == STATUS_BUFFER_TOO_SMALL, "got %08x\n", status );
- ok( len == sizeof(*sd_rel), "got %u\n", len );
+ ok( status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel), "got %lu\n", len );
len += 4;
status = RtlMakeSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
len = 0;
status = RtlAbsoluteToSelfRelativeSD( &sd, NULL, &len );
- ok( status == STATUS_BUFFER_TOO_SMALL, "got %08x\n", status );
- ok( len == sizeof(*sd_rel), "got %u\n", len );
+ ok( status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel), "got %lu\n", len );
len += 4;
status = RtlAbsoluteToSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
sd.Control = SE_SELF_RELATIVE;
status = RtlMakeSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
status = RtlAbsoluteToSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_BAD_DESCRIPTOR_FORMAT, "got %08x\n", status );
+ ok( status == STATUS_BAD_DESCRIPTOR_FORMAT, "got %08lx\n", status );
}
static DWORD (CALLBACK *orig_entry)(HMODULE,DWORD,LPVOID);
@@ -3275,7 +3276,7 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT
if (!lstrcmpiW(data->Loaded.BaseDllName->Buffer, expected_dll))
return;
- ok(data->Loaded.Flags == 0, "Expected flags 0, got %x\n", data->Loaded.Flags);
+ ok(data->Loaded.Flags == 0, "Expected flags 0, got %lx\n", data->Loaded.Flags);
ok(!lstrcmpiW(data->Loaded.BaseDllName->Buffer, expected_dll), "Expected %s, got %s\n",
wine_dbgstr_w(expected_dll), wine_dbgstr_w(data->Loaded.BaseDllName->Buffer));
ok(!!data->Loaded.DllBase, "Expected non zero base address\n");
@@ -3435,67 +3436,67 @@ static void test_LdrRegisterDllNotification(void)
/* generic test */
status = pLdrRegisterDllNotification(0, ldr_notify_callback1, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == LDR_DLL_NOTIFICATION_REASON_LOADED, "Expected LDR_DLL_NOTIFICATION_REASON_LOADED, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == LDR_DLL_NOTIFICATION_REASON_LOADED, "Expected LDR_DLL_NOTIFICATION_REASON_LOADED, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == LDR_DLL_NOTIFICATION_REASON_UNLOADED, "Expected LDR_DLL_NOTIFICATION_REASON_UNLOADED, got %x\n", calls);
+ ok(calls == LDR_DLL_NOTIFICATION_REASON_UNLOADED, "Expected LDR_DLL_NOTIFICATION_REASON_UNLOADED, got %lx\n", calls);
/* test order of callbacks */
status = pLdrRegisterDllNotification(0, ldr_notify_callback2, &calls, &cookie2);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x13, "Expected order 0x13, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x13, "Expected order 0x13, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == 0x24, "Expected order 0x24, got %x\n", calls);
+ ok(calls == 0x24, "Expected order 0x24, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie2);
pLdrUnregisterDllNotification(cookie);
/* test dll main order */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_dll_main, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x13, "Expected order 0x13, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x13, "Expected order 0x13, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == 0x42, "Expected order 0x42, got %x\n", calls);
+ ok(calls == 0x42, "Expected order 0x42, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie);
/* test dll main order */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_fail, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
ok(!mod, "Expected library to fail loading\n");
- ok(calls == 0x1342, "Expected order 0x1342, got %x\n", calls);
+ ok(calls == 0x1342, "Expected order 0x1342, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie);
/* test dll with dependencies */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_imports, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(wintrustdllW);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x12 || calls == 0x21, "got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x12 || calls == 0x21, "got %lx\n", calls);
FreeLibrary(mod);
pLdrUnregisterDllNotification(cookie);
@@ -3509,7 +3510,7 @@ static LONG CALLBACK test_dbg_print_except_handler( EXCEPTION_POINTERS *eptrs )
if (eptrs->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C)
{
ok( eptrs->ExceptionRecord->NumberParameters == 2,
- "Unexpected NumberParameters: %d\n", eptrs->ExceptionRecord->NumberParameters );
+ "Unexpected NumberParameters: %ld\n", eptrs->ExceptionRecord->NumberParameters );
ok( eptrs->ExceptionRecord->ExceptionInformation[0] == strlen("test_DbgPrint: Hello World") + 1,
"Unexpected ExceptionInformation[0]: %d\n", (int)eptrs->ExceptionRecord->ExceptionInformation[0] );
ok( !strcmp((char *)eptrs->ExceptionRecord->ExceptionInformation[1], "test_DbgPrint: Hello World"),
@@ -3551,26 +3552,26 @@ static void test_DbgPrint(void)
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C received\n" );
Peb->BeingDebugged = TRUE;
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_CONTINUE_EXECUTION;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_CONTINUE_SEARCH;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
@@ -3579,38 +3580,38 @@ static void test_DbgPrint(void)
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_ERROR_LEVEL, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_WARNING_LEVEL, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_MASK|(1 << DPFLTR_ERROR_LEVEL), "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_MASK|(1 << DPFLTR_WARNING_LEVEL), "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = test_vDbgPrintEx( 0, 0xFFFFFFFF, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "vDbgPrintEx returned %x\n", status );
+ ok( !status, "vDbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = test_vDbgPrintExWithPrefix( "test_", 0, 0xFFFFFFFF, "DbgPrint: %s", "Hello World" );
- ok( !status, "vDbgPrintExWithPrefix returned %x\n", status );
+ ok( !status, "vDbgPrintExWithPrefix returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
Peb->BeingDebugged = debugged;
1
0
1
0
[PATCH v2] ntdll: Avoid the lower 2GB region for large allocations on win64.
by Elaine Lefler March 23, 2022
by Elaine Lefler March 23, 2022
March 23, 2022
Fixes a crash in PaintTool SAI when allocating more than 2GB of memory.
Signed-off-by: Elaine Lefler <elaineclefler(a)gmail.com>
---
v2: Removed todo_wine from appropriate tests, along with a note about
why that test is broken on win32.
---
dlls/ntdll/tests/info.c | 16 ++++++++++++----
dlls/ntdll/unix/virtual.c | 6 +++++-
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index d3e70842b00..3652d907db5 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1840,8 +1840,13 @@ static void test_query_process_vm(void)
ok( pvi.PrivateUsage == pvi.PagefileUsage, "wrong value %Iu/%Iu\n", pvi.PrivateUsage, pvi.PagefileUsage );
if (winetest_debug > 1)
dump_vm_counters("VM counters after VirtualAlloc", &pvi);
- todo_wine ok( pvi.VirtualSize >= prev_size + alloc_size,
- "Expected to be greater than %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
+#ifndef _WIN64
+ /* Fails on win32 due to mapping in reserved areas. The unused regions
+ * should be subtracted from VirtualSize for it to succeed. */
+ todo_wine
+#endif
+ ok( pvi.VirtualSize >= prev_size + alloc_size,
+ "Expected to be at least %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
VirtualFree( ptr, 0, MEM_RELEASE);
status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessVmCounters, &pvi, sizeof(pvi), NULL);
@@ -1857,8 +1862,11 @@ static void test_query_process_vm(void)
ok( pvi.PrivateUsage == pvi.PagefileUsage, "wrong value %Iu/%Iu\n", pvi.PrivateUsage, pvi.PagefileUsage );
if (winetest_debug > 1)
dump_vm_counters("VM counters after VirtualAlloc(MEM_RESERVE)", &pvi);
- todo_wine ok( pvi.VirtualSize >= prev_size + alloc_size,
- "Expected to be greater than %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
+#ifndef _WIN64
+ todo_wine
+#endif
+ ok( pvi.VirtualSize >= prev_size + alloc_size,
+ "Expected to be at least %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
prev_size = pvi.VirtualSize;
ptr = VirtualAlloc(ptr, alloc_size, MEM_COMMIT, PAGE_READWRITE);
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 94b300c5057..eac9bcb1f83 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -1917,7 +1917,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
alloc.top_down = top_down;
alloc.limit = (void*)(get_zero_bits_mask( zero_bits ) & (UINT_PTR)user_space_limit);
- if (mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
+ if (
+#ifdef _WIN64
+ size < 2 * 1024 * 1024 &&
+#endif
+ mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
{
ptr = alloc.result;
TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size );
--
2.32.0 (Apple Git-132)
1
0
[PATCH 1/5] mfplat/sample: Simplify code for setting DirectX manager.
by Giovanni Mascellani March 23, 2022
by Giovanni Mascellani March 23, 2022
March 23, 2022
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
dlls/mfplat/sample.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c
index 8ef80eb5f24..527f44fd8fd 100644
--- a/dlls/mfplat/sample.c
+++ b/dlls/mfplat/sample.c
@@ -1214,13 +1214,9 @@ static HRESULT WINAPI sample_allocator_SetDirectXManager(IMFVideoSampleAllocator
IDirect3DDeviceManager9_Release(allocator->d3d9_device_manager);
if (allocator->dxgi_device_manager)
IMFDXGIDeviceManager_Release(allocator->dxgi_device_manager);
- allocator->d3d9_device_manager = NULL;
- allocator->dxgi_device_manager = NULL;
- if (dxgi_device_manager)
- allocator->dxgi_device_manager = dxgi_device_manager;
- else if (d3d9_device_manager)
- allocator->d3d9_device_manager = d3d9_device_manager;
+ allocator->d3d9_device_manager = d3d9_device_manager;
+ allocator->dxgi_device_manager = dxgi_device_manager;
LeaveCriticalSection(&allocator->cs);
--
2.35.1
3
7