From e20c4d5a6fd39ee16f4710c3a42a0af07372deef Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 26 Mar 2015 17:56:44 +0100 Subject: [PATCH] Removed various patches (accepted upstream). --- README.md | 2 +- debian/changelog | 4 + ...ace-conditions-when-progress-dialog-.patch | 48 --- ...2-Implement-GetFinalPathNameByHandle.patch | 28 +- ...dd-tests-for-GetFinalPathNameByHandl.patch | 253 ------------ ...-couple-more-file-information-class.patch} | 0 ...ne-a-couple-more-information-classes.patch | 88 ----- ...mplement-SetFileInformationByHandle.patch} | 0 ...memory-access-to-KI_USER_SHARED_DAT.patch} | 0 ...-mov-Eb-Gb-instruction-on-x86-proces.patch | 80 ---- ...Es-for-instruction-emulator-on-x86_.patch} | 0 patches/patchinstall.sh | 82 +--- ...nt-SetupOpenLog-SetupLogErrorA-Setup.patch | 367 ------------------ patches/setupapi-SetupLog/definition | 1 - 14 files changed, 30 insertions(+), 923 deletions(-) delete mode 100644 patches/browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch delete mode 100644 patches/kernel32-GetFinalPathNameByHandle/0002-kernel32-tests-Add-tests-for-GetFinalPathNameByHandl.patch rename patches/kernel32-SetFileInformationByHandle/{0002-include-Declare-a-couple-more-file-information-class.patch => 0001-include-Declare-a-couple-more-file-information-class.patch} (100%) delete mode 100644 patches/kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch rename patches/kernel32-SetFileInformationByHandle/{0003-kernel32-Implement-SetFileInformationByHandle.patch => 0002-kernel32-Implement-SetFileInformationByHandle.patch} (100%) rename patches/ntoskrnl-Emulator/{0002-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch => 0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch} (100%) delete mode 100644 patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-mov-Eb-Gb-instruction-on-x86-proces.patch rename patches/ntoskrnl-Emulator/{0003-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch => 0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch} (100%) delete mode 100644 patches/setupapi-SetupLog/0001-setupapi-Implement-SetupOpenLog-SetupLogErrorA-Setup.patch delete mode 100644 patches/setupapi-SetupLog/definition diff --git a/README.md b/README.md index dd18852a..b3087c9a 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ Included bug fixes and improvements * Implement ID3DXEffect::FindNextValidTechnique ([Wine Bug #34101](https://bugs.winehq.org/show_bug.cgi?id=34101)) * Implement IDXGIOutput::GetDesc * Implement SetFileInformationByHandle -* Implement SetupLogError[A|W] and Setup[Open|Close]Log +* ~~Implement SetupLogError[A|W] and Setup[Open|Close]Log~~ * Implement a Microsoft Yahei replacement font ([Wine Bug #13829](https://bugs.winehq.org/show_bug.cgi?id=13829)) * Implement additional stubs for vcomp dlls ([Wine Bug #31640](https://bugs.winehq.org/show_bug.cgi?id=31640)) * Implement an Arial replacement font ([Wine Bug #32323](https://bugs.winehq.org/show_bug.cgi?id=32323)) diff --git a/debian/changelog b/debian/changelog index 000edaa4..6ccd60c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ wine-staging (1.7.40) UNRELEASED; urgency=low * Removed patch to fix regression causing black screen on startup (accepted upstream). * Removed patch to fix edge cases in TOOLTIPS_GetTipText (fixed upstream). * Removed patch for IConnectionPoint/INetworkListManagerEvents stub interface (accepted upstream). + * Removed patch to fix race-condition when closing browseui IProcessDialog (accepted upstream). + * Removed patch with tests for GetFinalPathNameByHandleA/W (accepted upstream). + * Removed patch to emulate 'mov Eb, Gb' instruction on x86 processor architecture (accepted upstream). + * Removed patches for Setup*Log() functions (accepted upstream). -- Sebastian Lackner Mon, 23 Mar 2015 16:12:20 +0100 wine-staging (1.7.39) unstable; urgency=low diff --git a/patches/browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch b/patches/browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch deleted file mode 100644 index 98818720..00000000 --- a/patches/browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From da4415d947b792fc5e0de978cf22e68d2b6b8601 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 1 Mar 2015 03:52:06 +0100 -Subject: browseui: Avoid race-conditions when progress dialog is released - before thread terminates. - ---- - dlls/browseui/progressdlg.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c -index e61a4cc..7d07ee9 100644 ---- a/dlls/browseui/progressdlg.c -+++ b/dlls/browseui/progressdlg.c -@@ -235,6 +235,7 @@ static DWORD WINAPI dialog_thread(LPVOID lpParameter) - /* Note: until we set the hEvent in WM_INITDIALOG, the ProgressDialog object - * is protected by the critical section held by StartProgress */ - struct create_params *params = lpParameter; -+ ProgressDialog *This = params->This; - HWND hwnd; - MSG msg; - -@@ -252,6 +253,7 @@ static DWORD WINAPI dialog_thread(LPVOID lpParameter) - } - } - -+ IProgressDialog_Release(&This->IProgressDialog_iface); - return 0; - } - -@@ -341,10 +343,14 @@ static HRESULT WINAPI ProgressDialog_StartProgressDialog(IProgressDialog *iface, - return S_OK; /* as on XP */ - } - This->dwFlags = dwFlags; -+ - params.This = This; - params.hwndParent = hwndParent; - params.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - -+ /* thread holds one reference to ensure clean shutdown */ -+ IProgressDialog_AddRef(&This->IProgressDialog_iface); -+ - hThread = CreateThread(NULL, 0, dialog_thread, ¶ms, 0, NULL); - WaitForSingleObject(params.hEvent, INFINITE); - CloseHandle(params.hEvent); --- -2.3.0 - diff --git a/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch b/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch index b3a7b4a4..816af58f 100644 --- a/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch +++ b/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch @@ -1,4 +1,4 @@ -From ea5ae1b1a3c8654b83f7bcdccfd29fc644e7560e Mon Sep 17 00:00:00 2001 +From 849837db444c4fedb35f176c08db46f018adba28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 12 Aug 2014 20:24:14 +0200 Subject: kernel32: Implement GetFinalPathNameByHandle. @@ -7,8 +7,7 @@ Subject: kernel32: Implement GetFinalPathNameByHandle. .../api-ms-win-core-file-l1-2-0.spec | 4 +- dlls/kernel32/file.c | 182 +++++++++++++++++++++ dlls/kernel32/kernel32.spec | 4 +- - include/fileapi.h | 8 + - 4 files changed, 194 insertions(+), 4 deletions(-) + 3 files changed, 186 insertions(+), 4 deletions(-) diff --git a/dlls/api-ms-win-core-file-l1-2-0/api-ms-win-core-file-l1-2-0.spec b/dlls/api-ms-win-core-file-l1-2-0/api-ms-win-core-file-l1-2-0.spec index ebfd52e..cddf112 100644 @@ -217,7 +216,7 @@ index 006db1c..b3cc8c3 100644 +} \ No newline at end of file diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index 3719505..a272535 100644 +index 1179af2..90207e0 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -682,8 +682,8 @@ @@ -231,25 +230,6 @@ index 3719505..a272535 100644 @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) -diff --git a/include/fileapi.h b/include/fileapi.h -index 02bbbd4..0ccf9e9 100644 ---- a/include/fileapi.h -+++ b/include/fileapi.h -@@ -34,6 +34,14 @@ typedef struct _CREATEFILE2_EXTENDED_PARAMETERS { - - WINBASEAPI HANDLE WINAPI CreateFile2(LPCWSTR,DWORD,DWORD,DWORD,LPCREATEFILE2_EXTENDED_PARAMETERS); - -+#define FILE_NAME_NORMALIZED 0x0 -+#define FILE_NAME_OPENED 0x8 -+ -+#define VOLUME_NAME_DOS 0x0 -+#define VOLUME_NAME_GUID 0x1 -+#define VOLUME_NAME_NT 0x2 -+#define VOLUME_NAME_NONE 0x4 -+ - #ifdef __cplusplus - } - #endif -- -2.2.1 +2.3.3 diff --git a/patches/kernel32-GetFinalPathNameByHandle/0002-kernel32-tests-Add-tests-for-GetFinalPathNameByHandl.patch b/patches/kernel32-GetFinalPathNameByHandle/0002-kernel32-tests-Add-tests-for-GetFinalPathNameByHandl.patch deleted file mode 100644 index 64121ead..00000000 --- a/patches/kernel32-GetFinalPathNameByHandle/0002-kernel32-tests-Add-tests-for-GetFinalPathNameByHandl.patch +++ /dev/null @@ -1,253 +0,0 @@ -From 1186a3a107bd3476248f396ba23f46cf35a9286d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Tue, 12 Aug 2014 20:25:18 +0200 -Subject: kernel32/tests: Add tests for GetFinalPathNameByHandle - ---- - dlls/kernel32/tests/file.c | 204 +++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 204 insertions(+) - -diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c -index 8849eb3..3a94b8d 100644 ---- a/dlls/kernel32/tests/file.c -+++ b/dlls/kernel32/tests/file.c -@@ -34,6 +34,7 @@ - #include "winerror.h" - #include "winnls.h" - #include "fileapi.h" -+#include "ntsecapi.h" - - static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD); - static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOID); -@@ -46,6 +47,8 @@ static HANDLE (WINAPI *pOpenFileById)(HANDLE, LPFILE_ID_DESCRIPTOR, DWORD, DWORD - static BOOL (WINAPI *pSetFileValidData)(HANDLE, LONGLONG); - static HRESULT (WINAPI *pCopyFile2)(PCWSTR,PCWSTR,COPYFILE2_EXTENDED_PARAMETERS*); - static HANDLE (WINAPI *pCreateFile2)(LPCWSTR, DWORD, DWORD, DWORD, CREATEFILE2_EXTENDED_PARAMETERS*); -+static DWORD (WINAPI* pGetFinalPathNameByHandleA)(HANDLE, LPSTR, DWORD, DWORD); -+static DWORD (WINAPI* pGetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD, DWORD); - - static const char filename[] = "testfile.xxx"; - static const char sillytext[] = -@@ -83,6 +86,8 @@ static void InitFunctionPointers(void) - pSetFileValidData = (void *) GetProcAddress(hkernel32, "SetFileValidData"); - pCopyFile2 = (void *) GetProcAddress(hkernel32, "CopyFile2"); - pCreateFile2 = (void *) GetProcAddress(hkernel32, "CreateFile2"); -+ pGetFinalPathNameByHandleA = (void *) GetProcAddress(hkernel32, "GetFinalPathNameByHandleA"); -+ pGetFinalPathNameByHandleW = (void *) GetProcAddress(hkernel32, "GetFinalPathNameByHandleW"); - } - - static void test__hread( void ) -@@ -4182,6 +4187,203 @@ todo_wine - } - } - -+ -+static void test_GetFinalPathNameByHandleA(void) -+{ -+ static char prefix[] = "GetFinalPathNameByHandleA"; -+ static char dos_prefix[] = "\\\\?\\"; -+ char temp_path[MAX_PATH], test_path[MAX_PATH]; -+ char long_path[MAX_PATH], result_path[MAX_PATH]; -+ char dos_path[sizeof(dos_prefix) + MAX_PATH]; -+ HANDLE hFile; -+ DWORD count; -+ UINT ret; -+ -+ if (!pGetFinalPathNameByHandleA) -+ { -+ win_skip("GetFinalPathNameByHandleA is missing\n"); -+ return; -+ } -+ -+ /* Test calling with INVALID_HANDLE_VALUE */ -+ SetLastError(0xdeadbeaf); -+ count = pGetFinalPathNameByHandleA(INVALID_HANDLE_VALUE, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == 0, "Expected length 0, got %d\n", count); -+ ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %x\n", GetLastError()); -+ -+ count = GetTempPathA(MAX_PATH, temp_path); -+ ok(count, "Failed to get temp path, error %x\n", GetLastError()); -+ if (!count) return; -+ -+ ret = GetTempFileNameA(temp_path, prefix, 0, test_path); -+ ok(ret != 0, "GetTempFileNameA error %x\n", GetLastError()); -+ if (!ret) return; -+ -+ ret = GetLongPathNameA(test_path, long_path, MAX_PATH); -+ ok(ret != 0, "GetLongPathNameA error %x\n", GetLastError()); -+ if (!ret) return; -+ -+ hFile = CreateFileA(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, -+ CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); -+ ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA error %x\n", GetLastError()); -+ if (hFile == INVALID_HANDLE_VALUE) return; -+ -+ dos_path[0] = 0; -+ strcat(dos_path, dos_prefix); -+ strcat(dos_path, long_path); -+ -+ /* Test VOLUME_NAME_DOS with sufficient buffer size */ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleA(hFile, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); -+ if (count && count <= MAX_PATH) -+ ok(lstrcmpiA(dos_path, result_path) == 0, "Expected %s, got %s\n", dos_path, result_path); -+ -+ /* Test VOLUME_NAME_DOS with insufficient buffer size */ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleA(hFile, result_path, strlen(dos_path)-2, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); -+ ok(result_path[0] == 0x11, "Result path was modified\n"); -+ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleA(hFile, result_path, strlen(dos_path)-1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); -+ ok(result_path[0] == 0x11, "Result path was modified\n"); -+ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleA(hFile, result_path, strlen(dos_path), FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); -+ ok(result_path[0] == 0x11, "Result path was modified\n"); -+ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleA(hFile, result_path, strlen(dos_path)+1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == strlen(dos_path), "Expected length %u, got %u\n", (DWORD)strlen(dos_path), count); -+ ok(result_path[0] != 0x11, "Result path was not modified\n"); -+ ok(result_path[strlen(dos_path)+1] == 0x11, "Buffer overflow\n"); -+ -+ CloseHandle(hFile); -+} -+ -+static void test_GetFinalPathNameByHandleW(void) -+{ -+ static WCHAR prefix[] = {'G','e','t','F','i','n','a','l','P','a','t','h','N','a','m','e','B','y','H','a','n','d','l','e','W','\0'}; -+ static WCHAR dos_prefix[] = {'\\','\\','?','\\','\0'}; -+ WCHAR temp_path[MAX_PATH], test_path[MAX_PATH]; -+ WCHAR long_path[MAX_PATH], result_path[MAX_PATH]; -+ WCHAR dos_path[MAX_PATH + sizeof(dos_prefix)]; -+ WCHAR drive_part[MAX_PATH]; -+ WCHAR *file_part; -+ WCHAR volume_path[MAX_PATH+50]; -+ WCHAR nt_path[2*MAX_PATH]; -+ HANDLE hFile; -+ DWORD count; -+ UINT ret; -+ -+ if (!pGetFinalPathNameByHandleW) -+ { -+ win_skip("GetFinalPathNameByHandleW is missing\n"); -+ return; -+ } -+ -+ /* Test calling with INVALID_HANDLE_VALUE */ -+ SetLastError(0xdeadbeaf); -+ count = pGetFinalPathNameByHandleW(INVALID_HANDLE_VALUE, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == 0, "Expected length 0, got %d\n", count); -+ ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); -+ -+ count = GetTempPathW(MAX_PATH, temp_path); -+ ok(count, "Failed to get temp path, error %d\n", GetLastError()); -+ if (!count) return; -+ -+ ret = GetTempFileNameW(temp_path, prefix, 0, test_path); -+ ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); -+ if (!ret) return; -+ -+ ret = GetLongPathNameW(test_path, long_path, MAX_PATH); -+ ok(ret != 0, "GetLongPathNameW error %d\n", GetLastError()); -+ if (!ret) return; -+ -+ hFile = CreateFileW(test_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, -+ CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); -+ ok(hFile != INVALID_HANDLE_VALUE, "CreateFileW error %d\n", GetLastError()); -+ if (hFile == INVALID_HANDLE_VALUE) return; -+ -+ dos_path[0] = 0; -+ lstrcatW(dos_path, dos_prefix); -+ lstrcatW(dos_path, long_path); -+ -+ /* Test VOLUME_NAME_DOS with sufficient buffer size */ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == lstrlenW(dos_path), "Expected length %d, got %d\n", lstrlenW(dos_path), count); -+ if (count && count <= MAX_PATH) -+ ok(lstrcmpiW(dos_path, result_path) == 0, "Expected %s, got %s\n", wine_dbgstr_w(dos_path), wine_dbgstr_w(result_path)); -+ -+ /* Test VOLUME_NAME_DOS with insufficient buffer size */ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, lstrlenW(dos_path)-1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == lstrlenW(dos_path) + 1, "Expected length %d, got %d\n", lstrlenW(dos_path) + 1, count); -+ ok(result_path[0] == 0x1111, "Result path was modified\n"); -+ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, lstrlenW(dos_path), FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == lstrlenW(dos_path) + 1, "Expected length %d, got %d\n", lstrlenW(dos_path) + 1, count); -+ ok(result_path[0] == 0x1111, "Result path was modified\n"); -+ -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, lstrlenW(dos_path)+1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); -+ ok(count == lstrlenW(dos_path), "Expected length %d, got %d\n", lstrlenW(dos_path), count); -+ ok(result_path[0] != 0x1111, "Result path was not modified\n"); -+ ok(result_path[lstrlenW(dos_path)+1] == 0x1111, "Buffer overflow\n"); -+ -+ if (!GetVolumePathNameW(long_path, drive_part, MAX_PATH)) -+ { -+ ok(0, "Failed to get drive part, error: %d\n", GetLastError()); -+ CloseHandle(hFile); -+ return; -+ } -+ -+ if (!GetVolumeNameForVolumeMountPointW(drive_part, volume_path, sizeof(volume_path) / sizeof(WCHAR))) -+ ok(0, "GetVolumeNameForVolumeMountPointW failed, error: %d\n", GetLastError()); -+ else -+ { -+ /* Test for VOLUME_NAME_GUID */ -+ lstrcatW(volume_path, long_path + lstrlenW(drive_part)); -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_GUID); -+ ok(count == lstrlenW(volume_path), "Expected length %d, got %d\n", lstrlenW(volume_path), count); -+ if (count && count <= MAX_PATH) -+ ok(lstrcmpiW(volume_path, result_path) == 0, "Expected %s, got %s\n", -+ wine_dbgstr_w(volume_path), wine_dbgstr_w(result_path)); -+ } -+ -+ /* Test for VOLUME_NAME_NONE */ -+ file_part = long_path + lstrlenW(drive_part) - 1; -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_NONE); -+ ok(count == lstrlenW(file_part), "Expected length %d, got %d\n", lstrlenW(file_part), count); -+ if (count && count <= MAX_PATH) -+ ok(lstrcmpiW(file_part, result_path) == 0, "Expected %s, got %s\n", -+ wine_dbgstr_w(file_part), wine_dbgstr_w(result_path)); -+ -+ drive_part[lstrlenW(drive_part)-1] = 0; -+ if (!QueryDosDeviceW(drive_part, nt_path, sizeof(nt_path) / sizeof(WCHAR))) -+ ok(0, "QueryDosDeviceW failed, error: %d\n", GetLastError()); -+ else -+ { -+ /* Test for VOLUME_NAME_NT */ -+ lstrcatW(nt_path, file_part); -+ memset(result_path, 0x11, sizeof(result_path)); -+ count = pGetFinalPathNameByHandleW(hFile, result_path, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_NT); -+ ok(count == lstrlenW(nt_path), "Expected length %d, got %d\n", lstrlenW(nt_path), count); -+ if (count && count <= MAX_PATH) -+ ok(lstrcmpiW(nt_path, result_path) == 0, "Expected %s, got %s\n", -+ wine_dbgstr_w(nt_path), wine_dbgstr_w(result_path)); -+ } -+ -+ CloseHandle(hFile); -+} -+ - START_TEST(file) - { - InitFunctionPointers(); -@@ -4234,4 +4436,6 @@ START_TEST(file) - test_SetFileValidData(); - test_WriteFileGather(); - test_file_access(); -+ test_GetFinalPathNameByHandleA(); -+ test_GetFinalPathNameByHandleW(); - } --- -2.2.1 - diff --git a/patches/kernel32-SetFileInformationByHandle/0002-include-Declare-a-couple-more-file-information-class.patch b/patches/kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch similarity index 100% rename from patches/kernel32-SetFileInformationByHandle/0002-include-Declare-a-couple-more-file-information-class.patch rename to patches/kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch diff --git a/patches/kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch b/patches/kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch deleted file mode 100644 index d6a400f8..00000000 --- a/patches/kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch +++ /dev/null @@ -1,88 +0,0 @@ -From f85a2cc8b1911d19140e90dc317a565ef10e3b0f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Thu, 26 Feb 2015 05:27:14 +0100 -Subject: ntdll: Define a couple more information classes. - ---- - dlls/ntdll/file.c | 20 +++++++++++--------- - include/winternl.h | 28 +++++++++++++++++----------- - 2 files changed, 28 insertions(+), 20 deletions(-) - -diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 5232027..d05289e 100644 ---- a/dlls/ntdll/file.c -+++ b/dlls/ntdll/file.c -@@ -2042,20 +2042,22 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, - 0, /* FileIdFullDirectoryInformation */ - 0, /* FileValidDataLengthInformation */ - 0, /* FileShortNameInformation */ -- 0, -- 0, -- 0, -+ 0, /* FileIoCompletionNotificationInformation, */ -+ 0, /* FileIoStatusBlockRangeInformation */ -+ 0, /* FileIoPriorityHintInformation */ - 0, /* FileSfioReserveInformation */ - 0, /* FileSfioVolumeInformation */ - 0, /* FileHardLinkInformation */ -- 0, -+ 0, /* FileProcessIdsUsingFileInformation */ - 0, /* FileNormalizedNameInformation */ -- 0, -+ 0, /* FileNetworkPhysicalNameInformation */ - 0, /* FileIdGlobalTxDirectoryInformation */ -- 0, -- 0, -- 0, -- 0 /* FileStandardLinkInformation */ -+ 0, /* FileIsRemoteDeviceInformation */ -+ 0, /* FileAttributeCacheInformation */ -+ 0, /* FileNumaNodeInformation */ -+ 0, /* FileStandardLinkInformation */ -+ 0, /* FileRemoteProtocolInformation */ -+ 0, /* FileReplaceCompletionInformation */ - }; - - struct stat st; -diff --git a/include/winternl.h b/include/winternl.h -index 1a694da..d769ef0 100644 ---- a/include/winternl.h -+++ b/include/winternl.h -@@ -411,17 +411,23 @@ typedef enum _FILE_INFORMATION_CLASS { - FileIdBothDirectoryInformation, - FileIdFullDirectoryInformation, - FileValidDataLengthInformation, -- FileShortNameInformation = 40, -- /* 41, 42, 43 undocumented */ -- FileSfioReserveInformation = 44, -- FileSfioVolumeInformation = 45, -- FileHardLinkInformation = 46, -- /* 47 undocumented */ -- FileNormalizedNameInformation = 48, -- /* 49 undocumented */ -- FileIdGlobalTxDirectoryInformation = 50, -- /* 51, 52, 53 undocumented */ -- FileStandardLinkInformation = 54, -+ FileShortNameInformation, -+ FileIoCompletionNotificationInformation, -+ FileIoStatusBlockRangeInformation, -+ FileIoPriorityHintInformation, -+ FileSfioReserveInformation, -+ FileSfioVolumeInformation, -+ FileHardLinkInformation, -+ FileProcessIdsUsingFileInformation, -+ FileNormalizedNameInformation, -+ FileNetworkPhysicalNameInformation, -+ FileIdGlobalTxDirectoryInformation, -+ FileIsRemoteDeviceInformation, -+ FileAttributeCacheInformation, -+ FileNumaNodeInformation, -+ FileStandardLinkInformation, -+ FileRemoteProtocolInformation, -+ FileReplaceCompletionInformation, - FileMaximumInformation - } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; - --- -2.3.0 - diff --git a/patches/kernel32-SetFileInformationByHandle/0003-kernel32-Implement-SetFileInformationByHandle.patch b/patches/kernel32-SetFileInformationByHandle/0002-kernel32-Implement-SetFileInformationByHandle.patch similarity index 100% rename from patches/kernel32-SetFileInformationByHandle/0003-kernel32-Implement-SetFileInformationByHandle.patch rename to patches/kernel32-SetFileInformationByHandle/0002-kernel32-Implement-SetFileInformationByHandle.patch diff --git a/patches/ntoskrnl-Emulator/0002-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch b/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch similarity index 100% rename from patches/ntoskrnl-Emulator/0002-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch rename to patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch diff --git a/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-mov-Eb-Gb-instruction-on-x86-proces.patch b/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-mov-Eb-Gb-instruction-on-x86-proces.patch deleted file mode 100644 index 0671bb08..00000000 --- a/patches/ntoskrnl-Emulator/0001-ntoskrnl-Emulate-mov-Eb-Gb-instruction-on-x86-proces.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 332dcc33d8be2ab7cddeba6320bde968b5872246 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Mon, 10 Nov 2014 07:14:48 +0100 -Subject: ntoskrnl: Emulate 'mov Eb, Gb' instruction on x86 processor - architecture. - ---- - dlls/ntoskrnl.exe/instr.c | 33 ++++++++++++++++++++++++++++----- - 1 file changed, 28 insertions(+), 5 deletions(-) - -diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c -index fe35686..05cd238 100644 ---- a/dlls/ntoskrnl.exe/instr.c -+++ b/dlls/ntoskrnl.exe/instr.c -@@ -59,7 +59,7 @@ static inline struct idtr get_idtr(void) - } - - /* store an operand into a register */ --static void store_reg( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int long_op ) -+static void store_reg_word( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int long_op ) - { - switch((regmodrm >> 3) & 7) - { -@@ -98,6 +98,22 @@ static void store_reg( CONTEXT *context, BYTE regmodrm, const BYTE *addr, int lo - } - } - -+/* store an operand into a byte register */ -+static void store_reg_byte( CONTEXT *context, BYTE regmodrm, const BYTE *addr ) -+{ -+ switch((regmodrm >> 3) & 7) -+ { -+ case 0: context->Eax = (context->Eax & 0xffffff00) | *addr; break; -+ case 1: context->Ecx = (context->Ecx & 0xffffff00) | *addr; break; -+ case 2: context->Edx = (context->Edx & 0xffffff00) | *addr; break; -+ case 3: context->Ebx = (context->Ebx & 0xffffff00) | *addr; break; -+ case 4: context->Eax = (context->Eax & 0xffff00ff) | (*addr << 8); break; -+ case 5: context->Ecx = (context->Ecx & 0xffff00ff) | (*addr << 8); break; -+ case 6: context->Edx = (context->Edx & 0xffff00ff) | (*addr << 8); break; -+ case 7: context->Ebx = (context->Ebx & 0xffff00ff) | (*addr << 8); break; -+ } -+} -+ - /*********************************************************************** - * INSTR_GetOperandAddr - * -@@ -399,19 +415,26 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) - } - break; /* Unable to emulate it */ - -+ case 0x8a: /* mov Eb, Gb */ - case 0x8b: /* mov Ev, Gv */ - { -- BYTE *addr = INSTR_GetOperandAddr(context, instr + 1, long_addr, -+ BYTE *data = INSTR_GetOperandAddr(context, instr + 1, long_addr, - segprefix, &len); -+ unsigned int data_size = (*instr == 0x8b) ? (long_op ? 4 : 2) : 1; - struct idtr idtr = get_idtr(); -- unsigned int offset = addr - idtr.base; -+ unsigned int offset = data - idtr.base; - -- if (offset <= idtr.limit + 1 - (long_op ? 4 : 2)) -+ if (offset <= idtr.limit + 1 - data_size) - { - idt[1].LimitLow = 0x100; /* FIXME */ - idt[2].LimitLow = 0x11E; /* FIXME */ - idt[3].LimitLow = 0x500; /* FIXME */ -- store_reg( context, instr[1], (BYTE *)idt + offset, long_op ); -+ -+ switch (*instr) -+ { -+ case 0x8a: store_reg_byte( context, instr[1], (BYTE *)idt + offset ); break; -+ case 0x8b: store_reg_word( context, instr[1], (BYTE *)idt + offset, long_op ); break; -+ } - context->Eip += prefixlen + len + 1; - return ExceptionContinueExecution; - } --- -2.1.3 - diff --git a/patches/ntoskrnl-Emulator/0003-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch b/patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch similarity index 100% rename from patches/ntoskrnl-Emulator/0003-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch rename to patches/ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index d9df9445..1f0623ed 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -67,7 +67,6 @@ patch_enable_all () enable_Pipelight="$1" enable_Staging="$1" enable_browseui_Progress_Dialog="$1" - enable_browseui_Race_Conditions="$1" enable_combase_String="$1" enable_comctl32_LoadIconMetric="$1" enable_configure_Absolute_RPATH="$1" @@ -178,7 +177,6 @@ patch_enable_all () enable_server_Shared_Memory="$1" enable_server_Stored_ACLs="$1" enable_server_Unexpected_Wakeup="$1" - enable_setupapi_SetupLog="$1" enable_setupapi_SetupPromptForDisk="$1" enable_shdocvw_ParseURLFromOutsideSource_Tests="$1" enable_shell32_Default_Folder_ACLs="$1" @@ -257,9 +255,6 @@ patch_enable () browseui-Progress_Dialog) enable_browseui_Progress_Dialog="$2" ;; - browseui-Race_Conditions) - enable_browseui_Race_Conditions="$2" - ;; combase-String) enable_combase_String="$2" ;; @@ -590,9 +585,6 @@ patch_enable () server-Unexpected_Wakeup) enable_server_Unexpected_Wakeup="$2" ;; - setupapi-SetupLog) - enable_setupapi_SetupLog="$2" - ;; setupapi-SetupPromptForDisk) enable_setupapi_SetupPromptForDisk="$2" ;; @@ -1343,18 +1335,6 @@ if test "$enable_browseui_Progress_Dialog" -eq 1; then ) >> "$patchlist" fi -# Patchset browseui-Race_Conditions -# | -# | Modified files: -# | * dlls/browseui/progressdlg.c -# | -if test "$enable_browseui_Race_Conditions" -eq 1; then - patch_apply browseui-Race_Conditions/0001-browseui-Avoid-race-conditions-when-progress-dialog-.patch - ( - echo '+ { "Sebastian Lackner", "browseui: Avoid race-conditions when progress dialog is released before thread terminates.", 1 },'; - ) >> "$patchlist" -fi - # Patchset combase-String # | # | Modified files: @@ -2503,14 +2483,12 @@ fi # Patchset kernel32-SetFileInformationByHandle # | # | Modified files: -# | * dlls/kernel32/file.c, dlls/ntdll/file.c, include/winbase.h, include/winternl.h +# | * dlls/kernel32/file.c, include/winbase.h # | if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then - patch_apply kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch - patch_apply kernel32-SetFileInformationByHandle/0002-include-Declare-a-couple-more-file-information-class.patch - patch_apply kernel32-SetFileInformationByHandle/0003-kernel32-Implement-SetFileInformationByHandle.patch + patch_apply kernel32-SetFileInformationByHandle/0001-include-Declare-a-couple-more-file-information-class.patch + patch_apply kernel32-SetFileInformationByHandle/0002-kernel32-Implement-SetFileInformationByHandle.patch ( - echo '+ { "Michael Müller", "ntdll: Define a couple more information classes.", 1 },'; echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },'; echo '+ { "Michael Müller", "kernel32: Implement SetFileInformationByHandle.", 1 },'; ) >> "$patchlist" @@ -2538,15 +2516,12 @@ fi # | * [#34851] Support for GetFinalPathNameByHandle # | # | Modified files: -# | * dlls/api-ms-win-core-file-l1-2-0/api-ms-win-core-file-l1-2-0.spec, dlls/kernel32/file.c, dlls/kernel32/kernel32.spec, -# | dlls/kernel32/tests/file.c, include/fileapi.h +# | * dlls/api-ms-win-core-file-l1-2-0/api-ms-win-core-file-l1-2-0.spec, dlls/kernel32/file.c, dlls/kernel32/kernel32.spec # | if test "$enable_kernel32_GetFinalPathNameByHandle" -eq 1; then patch_apply kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch - patch_apply kernel32-GetFinalPathNameByHandle/0002-kernel32-tests-Add-tests-for-GetFinalPathNameByHandl.patch ( echo '+ { "Michael Müller", "kernel32: Implement GetFinalPathNameByHandle.", 1 },'; - echo '+ { "Michael Müller", "kernel32/tests: Add tests for GetFinalPathNameByHandle.", 1 },'; ) >> "$patchlist" fi @@ -3280,11 +3255,9 @@ fi # | * dlls/ntoskrnl.exe/instr.c, dlls/ntoskrnl.exe/ntoskrnl.c # | if test "$enable_ntoskrnl_Emulator" -eq 1; then - patch_apply ntoskrnl-Emulator/0001-ntoskrnl-Emulate-mov-Eb-Gb-instruction-on-x86-proces.patch - patch_apply ntoskrnl-Emulator/0002-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch - patch_apply ntoskrnl-Emulator/0003-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch + patch_apply ntoskrnl-Emulator/0001-ntoskrnl-Emulate-memory-access-to-KI_USER_SHARED_DAT.patch + patch_apply ntoskrnl-Emulator/0002-ntoskrnl-Add-TRACEs-for-instruction-emulator-on-x86_.patch ( - echo '+ { "Sebastian Lackner", "ntoskrnl: Emulate '\''mov Eb, Gb'\'' instruction on x86 processor architecture.", 1 },'; echo '+ { "Sebastian Lackner", "ntoskrnl: Emulate memory access to KI_USER_SHARED_DATA on x86_64.", 2 },'; echo '+ { "Sebastian Lackner", "ntoskrnl: Add TRACEs for instruction emulator on x86_64 to simplify debugging.", 1 },'; ) >> "$patchlist" @@ -3649,6 +3622,21 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then ) >> "$patchlist" fi +# Patchset server-OpenProcess +# | +# | This patchset fixes the following Wine bugs: +# | * [#37087] Return an error when trying to open a terminated process +# | +# | Modified files: +# | * server/process.c, server/process.h +# | +if test "$enable_server_OpenProcess" -eq 1; then + patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch + ( + echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },'; + ) >> "$patchlist" +fi + # Patchset server-Misc_ACL # | # | This patchset fixes the following Wine bugs: @@ -3666,21 +3654,6 @@ if test "$enable_server_Misc_ACL" -eq 1; then ) >> "$patchlist" fi -# Patchset server-OpenProcess -# | -# | This patchset fixes the following Wine bugs: -# | * [#37087] Return an error when trying to open a terminated process -# | -# | Modified files: -# | * server/process.c, server/process.h -# | -if test "$enable_server_OpenProcess" -eq 1; then - patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch - ( - echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },'; - ) >> "$patchlist" -fi - # Patchset server-JobObjects # | # | This patchset fixes the following Wine bugs: @@ -3827,19 +3800,6 @@ if test "$enable_server_Unexpected_Wakeup" -eq 1; then ) >> "$patchlist" fi -# Patchset setupapi-SetupLog -# | -# | Modified files: -# | * dlls/setupapi/Makefile.in, dlls/setupapi/log.c, dlls/setupapi/setupapi.spec, dlls/setupapi/setupcab.c, -# | dlls/setupapi/stubs.c, dlls/setupapi/tests/Makefile.in, dlls/setupapi/tests/log.c -# | -if test "$enable_setupapi_SetupLog" -eq 1; then - patch_apply setupapi-SetupLog/0001-setupapi-Implement-SetupOpenLog-SetupLogErrorA-Setup.patch - ( - echo '+ { "Pierre Schweitzer", "setupapi: Implement SetupOpenLog(), SetupLogErrorA(), SetupLogErrorW(), SetupCloseLog().", 1 },'; - ) >> "$patchlist" -fi - # Patchset setupapi-SetupPromptForDisk # | # | This patchset fixes the following Wine bugs: diff --git a/patches/setupapi-SetupLog/0001-setupapi-Implement-SetupOpenLog-SetupLogErrorA-Setup.patch b/patches/setupapi-SetupLog/0001-setupapi-Implement-SetupOpenLog-SetupLogErrorA-Setup.patch deleted file mode 100644 index 4b5bea39..00000000 --- a/patches/setupapi-SetupLog/0001-setupapi-Implement-SetupOpenLog-SetupLogErrorA-Setup.patch +++ /dev/null @@ -1,367 +0,0 @@ -From 8cf2c00710e8883fb7d05ca0b6d580776fe6d0f7 Mon Sep 17 00:00:00 2001 -From: Pierre Schweitzer -Date: Thu, 12 Mar 2015 17:56:06 +0100 -Subject: setupapi: Implement SetupOpenLog(), SetupLogErrorA(), - SetupLogErrorW(), SetupCloseLog() - ---- - dlls/setupapi/Makefile.in | 1 + - dlls/setupapi/log.c | 182 ++++++++++++++++++++++++++++++++++++++++ - dlls/setupapi/setupapi.spec | 2 +- - dlls/setupapi/setupcab.c | 1 + - dlls/setupapi/stubs.c | 26 ------ - dlls/setupapi/tests/Makefile.in | 1 + - dlls/setupapi/tests/log.c | 68 +++++++++++++++ - 7 files changed, 254 insertions(+), 27 deletions(-) - create mode 100644 dlls/setupapi/log.c - create mode 100644 dlls/setupapi/tests/log.c - -diff --git a/dlls/setupapi/Makefile.in b/dlls/setupapi/Makefile.in -index bf157cb..030b2d3 100644 ---- a/dlls/setupapi/Makefile.in -+++ b/dlls/setupapi/Makefile.in -@@ -11,6 +11,7 @@ C_SRCS = \ - diskspace.c \ - fakedll.c \ - install.c \ -+ log.c \ - misc.c \ - parser.c \ - query.c \ -diff --git a/dlls/setupapi/log.c b/dlls/setupapi/log.c -new file mode 100644 -index 0000000..d73085e ---- /dev/null -+++ b/dlls/setupapi/log.c -@@ -0,0 +1,182 @@ -+/* -+ * SetupAPI logs functions -+ * -+ * Copyright 2015 Pierre Schweitzer -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "wine/debug.h" -+#include "windef.h" -+#include "winbase.h" -+#include "winuser.h" -+#include "winreg.h" -+#include "setupapi.h" -+#include "winnls.h" -+ -+static HANDLE setupact = INVALID_HANDLE_VALUE; -+static HANDLE setuperr = INVALID_HANDLE_VALUE; -+static CRITICAL_SECTION setupapi_cs; -+static CRITICAL_SECTION_DEBUG critsect_debug = -+{ -+ 0, 0, &setupapi_cs, -+ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, -+ 0, 0, { (DWORD_PTR)(__FILE__ ": setupapi_cs") } -+}; -+static CRITICAL_SECTION setupapi_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; -+ -+/*********************************************************************** -+ * SetupCloseLog(SETUPAPI.@) -+ */ -+void WINAPI SetupCloseLog(void) -+{ -+ EnterCriticalSection(&setupapi_cs); -+ -+ if (setupact != INVALID_HANDLE_VALUE) -+ { -+ CloseHandle(setupact); -+ setupact = INVALID_HANDLE_VALUE; -+ } -+ -+ if (setuperr != INVALID_HANDLE_VALUE) -+ { -+ CloseHandle(setuperr); -+ setuperr = INVALID_HANDLE_VALUE; -+ } -+ -+ LeaveCriticalSection(&setupapi_cs); -+} -+ -+/*********************************************************************** -+ * SetupLogErrorA(SETUPAPI.@) -+ */ -+BOOL WINAPI SetupLogErrorA(LPCSTR message, LogSeverity severity) -+{ -+ static const CHAR null[] = "(null)"; -+ DWORD written; -+ DWORD len; -+ BOOL ret; -+ -+ EnterCriticalSection(&setupapi_cs); -+ -+ if (setupact == INVALID_HANDLE_VALUE || setuperr == INVALID_HANDLE_VALUE) -+ { -+ SetLastError(ERROR_FILE_INVALID); -+ ret = FALSE; -+ goto done; -+ } -+ -+ if (message == NULL) -+ message = null; -+ -+ len = lstrlenA(message) * sizeof(CHAR); -+ ret = WriteFile(setupact, message, len, &written, NULL); -+ if (!ret) -+ goto done; -+ -+ if (severity >= LogSevMaximum) -+ { -+ ret = FALSE; -+ goto done; -+ } -+ -+ if (severity > LogSevInformation) -+ ret = WriteFile(setuperr, message, len, &written, NULL); -+ -+done: -+ LeaveCriticalSection(&setupapi_cs); -+ return ret; -+} -+ -+/*********************************************************************** -+ * SetupLogErrorW(SETUPAPI.@) -+ */ -+BOOL WINAPI SetupLogErrorW(LPCWSTR message, LogSeverity severity) -+{ -+ LPSTR msg = NULL; -+ DWORD len; -+ BOOL ret; -+ -+ if (message) -+ { -+ len = WideCharToMultiByte(CP_ACP, 0, message, -1, NULL, 0, NULL, NULL); -+ msg = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR)); -+ if (msg == NULL) -+ { -+ SetLastError(ERROR_NOT_ENOUGH_MEMORY); -+ return FALSE; -+ } -+ WideCharToMultiByte(CP_ACP, 0, message, -1, msg, len, NULL, NULL); -+ } -+ -+ /* This is the normal way to proceed. The log files are ASCII files -+ * and W is to be converted. */ -+ ret = SetupLogErrorA(msg, severity); -+ -+ if (msg) -+ HeapFree(GetProcessHeap(), 0, msg); -+ -+ return ret; -+} -+ -+/*********************************************************************** -+ * SetupOpenLog(SETUPAPI.@) -+ */ -+BOOL WINAPI SetupOpenLog(BOOL reserved) -+{ -+ static const WCHAR setupactlog[] = {'\\','s','e','t','u','p','a','c','t','.','l','o','g',0}; -+ static const WCHAR setuperrlog[] = {'\\','s','e','t','u','p','e','r','r','.','l','o','g',0}; -+ WCHAR path[MAX_PATH]; -+ WCHAR win[MAX_PATH]; -+ -+ EnterCriticalSection(&setupapi_cs); -+ -+ if (setupact != INVALID_HANDLE_VALUE && setuperr != INVALID_HANDLE_VALUE) -+ { -+ LeaveCriticalSection(&setupapi_cs); -+ SetLastError(ERROR_ALREADY_INITIALIZED); -+ return TRUE; -+ } -+ -+ GetWindowsDirectoryW(win, MAX_PATH); -+ -+ lstrcpyW(path, win); -+ lstrcatW(path, setupactlog); -+ setupact = CreateFileW(path, FILE_GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, -+ NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); -+ if (setupact == INVALID_HANDLE_VALUE) -+ { -+ LeaveCriticalSection(&setupapi_cs); -+ return FALSE; -+ } -+ SetFilePointer(setupact, 0, NULL, FILE_END); -+ -+ lstrcpyW(path, win); -+ lstrcatW(path, setuperrlog); -+ setuperr = CreateFileW(path, FILE_GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, -+ NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); -+ if (setuperr == INVALID_HANDLE_VALUE) -+ { -+ CloseHandle(setupact); -+ setupact = INVALID_HANDLE_VALUE; -+ LeaveCriticalSection(&setupapi_cs); -+ return FALSE; -+ } -+ SetFilePointer(setuperr, 0, NULL, FILE_END); -+ -+ LeaveCriticalSection(&setupapi_cs); -+ SetLastError(ERROR_ALREADY_EXISTS); -+ return TRUE; -+} -diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec -index 4fcf298..c1dbed5 100644 ---- a/dlls/setupapi/setupapi.spec -+++ b/dlls/setupapi/setupapi.spec -@@ -459,7 +459,7 @@ - @ stdcall SetupInstallServicesFromInfSectionW(long wstr long) - @ stdcall SetupIterateCabinetA(str long ptr ptr) - @ stdcall SetupIterateCabinetW(wstr long ptr ptr) --@ stub SetupLogErrorA -+@ stdcall SetupLogErrorA(str long) - @ stdcall SetupLogErrorW(wstr long) - @ stdcall SetupLogFileA(ptr str str str long str str str long) - @ stdcall SetupLogFileW(ptr wstr wstr wstr long wstr wstr wstr long) -diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c -index 21336d7..54c0256 100644 ---- a/dlls/setupapi/setupcab.c -+++ b/dlls/setupapi/setupcab.c -@@ -694,6 +694,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) - break; - case DLL_PROCESS_DETACH: - if (lpvReserved) break; -+ SetupCloseLog(); - if (CABINET_hInstance) FreeLibrary(CABINET_hInstance); - break; - } -diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c -index 673bbbf..a57f5fe 100644 ---- a/dlls/setupapi/stubs.c -+++ b/dlls/setupapi/stubs.c -@@ -189,32 +189,6 @@ BOOL WINAPI RegistryDelnode(DWORD x, DWORD y) - } - - /*********************************************************************** -- * SetupCloseLog(SETUPAPI.@) -- */ --void WINAPI SetupCloseLog(void) --{ -- FIXME("() stub\n"); --} -- --/*********************************************************************** -- * SetupLogErrorW(SETUPAPI.@) -- */ --BOOL WINAPI SetupLogErrorW(LPCWSTR MessageString, LogSeverity Severity) --{ -- FIXME("(%s, %d) stub\n", debugstr_w(MessageString), Severity); -- return TRUE; --} -- --/*********************************************************************** -- * SetupOpenLog(SETUPAPI.@) -- */ --BOOL WINAPI SetupOpenLog(BOOL Reserved) --{ -- FIXME("(%d) stub\n", Reserved); -- return TRUE; --} -- --/*********************************************************************** - * SetupPromptReboot(SETUPAPI.@) - */ - INT WINAPI SetupPromptReboot( HSPFILEQ file_queue, HWND owner, BOOL scan_only ) -diff --git a/dlls/setupapi/tests/Makefile.in b/dlls/setupapi/tests/Makefile.in -index 30902e7..32ce41f 100644 ---- a/dlls/setupapi/tests/Makefile.in -+++ b/dlls/setupapi/tests/Makefile.in -@@ -6,4 +6,5 @@ C_SRCS = \ - diskspace.c \ - install.c \ -+ log.c \ - misc.c \ - parser.c \ -diff --git a/dlls/setupapi/tests/log.c b/dlls/setupapi/tests/log.c -new file mode 100644 -index 0000000..5de009e ---- /dev/null -+++ b/dlls/setupapi/tests/log.c -@@ -0,0 +1,68 @@ -+/* -+ * Unit tests for setupapi.dll log functions -+ * -+ * Copyright (C) 2015 Pierre Schweitzer -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include -+#include -+#include -+#include "wine/test.h" -+ -+static void test_SetupLogError(void) -+{ -+ BOOL ret; -+ DWORD error; -+ -+ SetLastError(0xdeadbeef); -+ ret = SetupLogErrorA("Test without opening\r\n", LogSevInformation); -+ error = GetLastError(); -+ ok(!ret, "SetupLogError succeeded\n"); -+ ok(error == ERROR_FILE_INVALID, "got wrong error: %d\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = SetupOpenLog(FALSE); -+ error = GetLastError(); -+ ok(ret, "SetupOpenLog failed\n"); -+ ok(error == ERROR_ALREADY_EXISTS, "got wrong error: %d\n", error); /* Even if log file didn't exist */ -+ -+ SetLastError(0xdeadbeef); -+ ret = SetupLogErrorA("Test with wrong log severity\r\n", LogSevMaximum); -+ error = GetLastError(); -+ ok(!ret, "SetupLogError succeeded\n"); -+ ok(error == 0xdeadbeef, "got wrong error: %d\n", error); -+ ret = SetupLogErrorA("Test without EOL", LogSevInformation); -+ ok(ret, "SetupLogError failed\n"); -+ -+ SetLastError(0xdeadbeef); -+ ret = SetupLogErrorA(NULL, LogSevInformation); -+ ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_PARAMETER /* Win Vista+ */), -+ "SetupLogError failed: %08x\n", GetLastError()); -+ -+ SetLastError(0xdeadbeef); -+ ret = SetupOpenLog(FALSE); -+ error = GetLastError(); -+ ok(ret, "SetupOpenLog failed\n"); -+ ok(error == ERROR_ALREADY_INITIALIZED, "got wrong error: %d\n", error); -+ -+ SetupCloseLog(); -+} -+ -+START_TEST(log) -+{ -+ test_SetupLogError(); -+} --- -2.3.2 - diff --git a/patches/setupapi-SetupLog/definition b/patches/setupapi-SetupLog/definition deleted file mode 100644 index c8504205..00000000 --- a/patches/setupapi-SetupLog/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: Implement SetupLogError[A|W] and Setup[Open|Close]Log