ntdll/tests: GetVolumePathnameW is not present before w2k.

oldstable
Detlef Riekenberg 2009-11-12 23:42:53 +01:00 committed by Alexandre Julliard
parent a679b4e3af
commit 447e224380
1 changed files with 12 additions and 1 deletions

View File

@ -40,6 +40,8 @@
#define IO_COMPLETION_ALL_ACCESS 0x001F0003 #define IO_COMPLETION_ALL_ACCESS 0x001F0003
#endif #endif
static BOOL (WINAPI * pGetVolumePathNameW)(LPCWSTR, LPWSTR, DWORD);
static NTSTATUS (WINAPI *pRtlFreeUnicodeString)( PUNICODE_STRING ); static NTSTATUS (WINAPI *pRtlFreeUnicodeString)( PUNICODE_STRING );
static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR ); static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR );
static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)( LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR* ); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)( LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR* );
@ -950,6 +952,12 @@ static void test_file_name_information(void)
HANDLE h; HANDLE h;
UINT len; UINT len;
/* GetVolumePathName is not present before w2k */
if (!pGetVolumePathNameW) {
win_skip("GetVolumePathNameW not found\n");
return;
}
file_name_size = GetSystemDirectoryW( NULL, 0 ); file_name_size = GetSystemDirectoryW( NULL, 0 );
file_name = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*file_name) ); file_name = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*file_name) );
volume_prefix = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*volume_prefix) ); volume_prefix = HeapAlloc( GetProcessHeap(), 0, file_name_size * sizeof(*volume_prefix) );
@ -960,7 +968,7 @@ static void test_file_name_information(void)
"GetSystemDirectoryW returned %u, expected %u.\n", "GetSystemDirectoryW returned %u, expected %u.\n",
len, file_name_size - 1); len, file_name_size - 1);
len = GetVolumePathNameW( file_name, volume_prefix, file_name_size ); len = pGetVolumePathNameW( file_name, volume_prefix, file_name_size );
ok(len, "GetVolumePathNameW failed.\n"); ok(len, "GetVolumePathNameW failed.\n");
len = lstrlenW( volume_prefix ); len = lstrlenW( volume_prefix );
@ -1018,6 +1026,7 @@ static void test_file_name_information(void)
START_TEST(file) START_TEST(file)
{ {
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
HMODULE hntdll = GetModuleHandleA("ntdll.dll"); HMODULE hntdll = GetModuleHandleA("ntdll.dll");
if (!hntdll) if (!hntdll)
{ {
@ -1025,6 +1034,8 @@ START_TEST(file)
return; return;
} }
pGetVolumePathNameW = (void *)GetProcAddress(hkernel32, "GetVolumePathNameW");
pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString");
pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString");
pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U"); pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");