Added patch to assign a drive serial number during prefix creation/update.

This commit is contained in:
Sebastian Lackner 2015-05-25 06:10:28 +02:00
parent 7f9bf47dd0
commit 83cbd1daaa
5 changed files with 77 additions and 6 deletions

View File

@ -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]:**

1
debian/changelog vendored
View File

@ -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

View File

@ -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

View File

@ -0,0 +1,69 @@
From 43f7ab85737327c3f13ace230f8eba0cf0414441 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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 <shobjidl.h>
#include <shlwapi.h>
#include <shellapi.h>
+#include <ntsecapi.h>
#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

View File

@ -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