From 83cbd1daaac07181b999b7208dbb6048089b2ea2 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 25 May 2015 06:10:28 +0200 Subject: [PATCH] Added patch to assign a drive serial number during prefix creation/update. --- README.md | 3 +- debian/changelog | 1 + patches/patchinstall.sh | 7 +- ...a-drive-serial-number-during-prefix-.patch | 69 +++++++++++++++++++ patches/wineboot-MachineGuid/definition | 3 +- 5 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 patches/wineboot-MachineGuid/0002-wineboot-Assign-a-drive-serial-number-during-prefix-.patch diff --git a/README.md b/README.md index b48e1ff9..21f432d7 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,12 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [3]:** +**Bug fixes and features included in the next upcoming release [4]:** * Add shell32 placeholder icons to match offsets with Windows ([Wine Bug #30185](https://bugs.winehq.org/show_bug.cgi?id=30185)) * Add stubbed ISWbemSecurity interfaces in wbemdisp * Also handle '\r' as whitespace in wbemprox queries +* Assign a drive serial number during prefix creation/update ([Wine Bug #17823](https://bugs.winehq.org/show_bug.cgi?id=17823)) **Bug fixes and features in Wine Staging 1.7.43 [235]:** diff --git a/debian/changelog b/debian/changelog index 531f4a27..f3ad863b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ wine-staging (1.7.44) UNRELEASED; urgency=low * Added patch to handle '\r' as whitespace in wbemprox queries. * Added patch with stubbed ISWbemSecurity interfaces in wbemdisp. * Added patch with shell32 placeholder icons to match offsets with Windows. + * Added patch to assign a drive serial number during prefix creation/update. * Removed patch to reset device state in SysKeyboard*Impl_Acquire (accepted upstream). * Removed patch to avoid creating thread queues for foreign threads in diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4a4b08c0..de775c45 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -1467,9 +1467,6 @@ if test "$enable_category_stable" -eq 1; then if test "$enable_wineboot_HKEY_DYN_DATA" -gt 1; then abort "Patchset wineboot-HKEY_DYN_DATA disabled, but category-stable depends on that." fi - if test "$enable_wineboot_MachineGuid" -gt 1; then - abort "Patchset wineboot-MachineGuid disabled, but category-stable depends on that." - fi if test "$enable_winebuild_LinkerVersion" -gt 1; then abort "Patchset winebuild-LinkerVersion disabled, but category-stable depends on that." fi @@ -1596,7 +1593,6 @@ if test "$enable_category_stable" -eq 1; then enable_wine_inf_Performance=1 enable_wine_inf_ProfileList_UserSID=1 enable_wineboot_HKEY_DYN_DATA=1 - enable_wineboot_MachineGuid=1 enable_winebuild_LinkerVersion=1 enable_winecfg_Libraries=1 enable_wined3d_Multisampling=1 @@ -5294,14 +5290,17 @@ fi # | # | This patchset fixes the following Wine bugs: # | * [#38508] Create HKLM\Software\Microsoft\Cryptography\MachineGuid registry key +# | * [#17823] Assign a drive serial number during prefix creation/update # | # | Modified files: # | * programs/wineboot/Makefile.in, programs/wineboot/wineboot.c # | if test "$enable_wineboot_MachineGuid" -eq 1; then patch_apply wineboot-MachineGuid/0001-wineboot-Create-MachineGuid-registry-value.patch + patch_apply wineboot-MachineGuid/0002-wineboot-Assign-a-drive-serial-number-during-prefix-.patch ( echo '+ { "Michael Müller", "wineboot: Create MachineGuid registry value.", 1 },'; + echo '+ { "Sebastian Lackner", "wineboot: Assign a drive serial number during prefix creation/update.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/wineboot-MachineGuid/0002-wineboot-Assign-a-drive-serial-number-during-prefix-.patch b/patches/wineboot-MachineGuid/0002-wineboot-Assign-a-drive-serial-number-during-prefix-.patch new file mode 100644 index 00000000..ed5f98dc --- /dev/null +++ b/patches/wineboot-MachineGuid/0002-wineboot-Assign-a-drive-serial-number-during-prefix-.patch @@ -0,0 +1,69 @@ +From 43f7ab85737327c3f13ace230f8eba0cf0414441 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 25 May 2015 06:07:50 +0200 +Subject: wineboot: Assign a drive serial number during prefix creation/update. + +--- + programs/wineboot/wineboot.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c +index 4d70ea9..dbabfe4 100644 +--- a/programs/wineboot/wineboot.c ++++ b/programs/wineboot/wineboot.c +@@ -81,6 +81,7 @@ + #include + #include + #include ++#include + #include "resource.h" + + WINE_DEFAULT_DEBUG_CHANNEL(wineboot); +@@ -165,6 +166,36 @@ static DWORD set_reg_value( HKEY hkey, const WCHAR *name, const WCHAR *value ) + return RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)value, (strlenW(value) + 1) * sizeof(WCHAR) ); + } + ++/* set a serial number for the disk containing windows */ ++static void create_disk_serial_number(void) ++{ ++ static const WCHAR filename[] = {'\\','.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0}; ++ DWORD serial, written; ++ WCHAR path[MAX_PATH]; ++ char buffer[16]; ++ HANDLE file; ++ ++ if (GetSystemDirectoryW( path, sizeof(path)/sizeof(path[0]) ) && path[1] == ':') ++ { ++ path[2] = 0; ++ strcatW( path, filename ); ++ if (!PathFileExistsW( path ) && RtlGenRandom( &serial, sizeof(serial) )) ++ { ++ WINE_TRACE( "Putting serial number of %08X into file %s\n", serial, wine_dbgstr_w(path) ); ++ file = CreateFileW( path, GENERIC_WRITE, FILE_SHARE_READ, NULL, ++ CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); ++ if (file == INVALID_HANDLE_VALUE) ++ WINE_ERR( "wine: failed to create %s.\n", wine_dbgstr_w(path) ); ++ else ++ { ++ sprintf( buffer, "%X\n", serial ); ++ WriteFile( file, buffer, strlen(buffer), &written, NULL ); ++ CloseHandle( file ); ++ } ++ } ++ } ++} ++ + /* create the volatile hardware registry keys */ + static void create_hardware_registry_keys(void) + { +@@ -1233,6 +1264,7 @@ int main( int argc, char *argv[] ) + + ResetEvent( event ); /* in case this is a restart */ + ++ create_disk_serial_number(); + create_hardware_registry_keys(); + create_dynamic_registry_keys(); + create_environment_registry_keys(); +-- +2.4.0 + diff --git a/patches/wineboot-MachineGuid/definition b/patches/wineboot-MachineGuid/definition index 4c74cd7b..d7e6e82e 100644 --- a/patches/wineboot-MachineGuid/definition +++ b/patches/wineboot-MachineGuid/definition @@ -1,2 +1,3 @@ Fixes: [38508] Create HKLM\Software\Microsoft\Cryptography\MachineGuid registry key -Category: stable +Fixes: [17823] Assign a drive serial number during prefix creation/update +#Category: stable