wine-staging/patches/kernel32-MoveFile/0001-kernel32-tests-Fix-compilation-with-PSDK.patch
2016-11-15 21:40:30 +01:00

109 lines
5.2 KiB
Diff

From f77e3080ec1b930e5ad669fb863d03330f956afc Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 15 Nov 2016 12:41:46 +0800
Subject: kernel32/tests: Fix compilation with PSDK.
---
dlls/kernel32/tests/file.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 5d21343..464da86 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -38,9 +38,7 @@
#include "winnls.h"
#include "fileapi.h"
-#ifdef WINE_NO_UNICODE_MACROS
#undef DeleteFile /* needed for FILE_DISPOSITION_INFO */
-#endif
static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOID);
@@ -60,6 +58,8 @@ static NTSTATUS (WINAPI *pNtCreateFile)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES
static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(LPCWSTR, PUNICODE_STRING, PWSTR*, CURDIR*);
static NTSTATUS (WINAPI *pRtlAnsiStringToUnicodeString)(PUNICODE_STRING, PCANSI_STRING, BOOLEAN);
static BOOL (WINAPI *pSetFileInformationByHandle)(HANDLE, FILE_INFO_BY_HANDLE_CLASS, void*, DWORD);
+static void (WINAPI *pRtlInitAnsiString)(PANSI_STRING,PCSZ);
+static void (WINAPI *pRtlFreeUnicodeString)(PUNICODE_STRING);
static const char filename[] = "testfile.xxx";
static const char sillytext[] =
@@ -90,6 +90,8 @@ static void InitFunctionPointers(void)
pNtCreateFile = (void *)GetProcAddress(hntdll, "NtCreateFile");
pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");
pRtlAnsiStringToUnicodeString = (void *)GetProcAddress(hntdll, "RtlAnsiStringToUnicodeString");
+ pRtlInitAnsiString = (void *)GetProcAddress(hntdll, "RtlInitAnsiString");
+ pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString");
pFindFirstFileExA=(void*)GetProcAddress(hkernel32, "FindFirstFileExA");
pReplaceFileA=(void*)GetProcAddress(hkernel32, "ReplaceFileA");
@@ -268,7 +270,8 @@ static void get_nt_pathW( const char *name, UNICODE_STRING *nameW )
ANSI_STRING str;
NTSTATUS status;
BOOLEAN ret;
- RtlInitAnsiString( &str, name );
+
+ pRtlInitAnsiString( &str, name );
status = pRtlAnsiStringToUnicodeString( &strW, &str, TRUE );
ok( !status, "RtlAnsiStringToUnicodeString failed with %08x\n", status );
@@ -276,7 +279,7 @@ static void get_nt_pathW( const char *name, UNICODE_STRING *nameW )
ret = pRtlDosPathNameToNtPathName_U( strW.Buffer, nameW, NULL, NULL );
ok( ret, "RtlDosPathNameToNtPathName_U failed\n" );
- RtlFreeUnicodeString( &strW );
+ pRtlFreeUnicodeString( &strW );
}
static void test__lcreat( void )
@@ -352,30 +355,30 @@ static void test__lcreat( void )
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- status = NtCreateFile( &file, GENERIC_READ | GENERIC_WRITE | DELETE, &attr, &io, NULL, 0,
+ status = pNtCreateFile( &file, GENERIC_READ | GENERIC_WRITE | DELETE, &attr, &io, NULL, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 );
ok( status == STATUS_ACCESS_DENIED, "expected STATUS_ACCESS_DENIED, got %08x\n", status );
ok( GetFileAttributesA( filename ) != INVALID_FILE_ATTRIBUTES, "file was deleted\n" );
- status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
+ status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 );
ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status );
- status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
+ status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_DIRECTORY_FILE, NULL, 0 );
ok( status == STATUS_NOT_A_DIRECTORY, "expected STATUS_NOT_A_DIRECTORY, got %08x\n", status );
- status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
+ status = pNtCreateFile( &file, DELETE, &attr, &io, NULL, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN_IF, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 );
todo_wine
ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status );
if (!status) CloseHandle( file );
- RtlFreeUnicodeString( &filenameW );
+ pRtlFreeUnicodeString( &filenameW );
todo_wine
ok( GetFileAttributesA( filename ) != INVALID_FILE_ATTRIBUTES, "file was deleted\n" );
@@ -4722,7 +4725,7 @@ static void test_SetFileInformationByHandle(void)
{
FILE_ATTRIBUTE_TAG_INFO fileattrinfo = { 0 };
FILE_REMOTE_PROTOCOL_INFO protinfo = { 0 };
- FILE_STANDARD_INFO stdinfo = { };
+ FILE_STANDARD_INFO stdinfo = { {{0}},{{0}},0,FALSE,FALSE };
FILE_COMPRESSION_INFO compressinfo;
FILE_DISPOSITION_INFO dispinfo;
char tempFileName[MAX_PATH];
--
2.9.0