2015-06-11 10:19:47 -07:00
|
|
|
From 0c883377270217830a782ba89958c39b25f81da0 Mon Sep 17 00:00:00 2001
|
2015-05-03 09:52:56 -07:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Sun, 3 May 2015 18:47:30 +0200
|
|
|
|
Subject: wineboot: Create MachineGuid registry value.
|
|
|
|
|
|
|
|
---
|
|
|
|
programs/wineboot/Makefile.in | 2 +-
|
2015-06-11 10:19:47 -07:00
|
|
|
programs/wineboot/wineboot.c | 33 +++++++++++++++++++++++++++++++++
|
|
|
|
2 files changed, 34 insertions(+), 1 deletion(-)
|
2015-05-03 09:52:56 -07:00
|
|
|
|
|
|
|
diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in
|
|
|
|
index f6da0f9..525abde 100644
|
|
|
|
--- a/programs/wineboot/Makefile.in
|
|
|
|
+++ b/programs/wineboot/Makefile.in
|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
MODULE = wineboot.exe
|
|
|
|
APPMODE = -mconsole
|
|
|
|
IMPORTS = uuid advapi32
|
|
|
|
-DELAYIMPORTS = shell32 shlwapi version user32
|
|
|
|
+DELAYIMPORTS = shell32 shlwapi version user32 rpcrt4
|
|
|
|
|
|
|
|
C_SRCS = \
|
|
|
|
shutdown.c \
|
|
|
|
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
|
2015-06-11 10:19:47 -07:00
|
|
|
index 4d70ea9..24bc872 100644
|
2015-05-03 09:52:56 -07:00
|
|
|
--- a/programs/wineboot/wineboot.c
|
|
|
|
+++ b/programs/wineboot/wineboot.c
|
2015-06-11 10:19:47 -07:00
|
|
|
@@ -361,6 +361,38 @@ static void create_environment_registry_keys( void )
|
2015-05-03 09:52:56 -07:00
|
|
|
RegCloseKey( env_key );
|
|
|
|
}
|
|
|
|
|
|
|
|
+/* create Cryptography registry keys */
|
|
|
|
+static void create_cryptography_registry_keys( void )
|
|
|
|
+{
|
|
|
|
+ static const WCHAR CryptographyW[] = {'S','o','f','t','w','a','r','e','\\',
|
|
|
|
+ 'M','i','c','r','o','s','o','f','t','\\',
|
|
|
|
+ 'C','r','y','p','t','o','g','r','a','p','h','y',0};
|
|
|
|
+ static const WCHAR MachineGuidW[] = {'M','a','c','h','i','n','e','G','u','i','d',0};
|
|
|
|
+ static const WCHAR formatW[] =
|
|
|
|
+ {
|
|
|
|
+ '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
|
|
|
|
+ '2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2',
|
|
|
|
+ 'x','%','0','2','x','%','0','2','x','%','0','2','x',0
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ HKEY crypt_key;
|
|
|
|
+ WCHAR buffer[37];
|
|
|
|
+ UUID uuid;
|
|
|
|
+
|
|
|
|
+ if (RegCreateKeyW( HKEY_LOCAL_MACHINE, CryptographyW, &crypt_key )) return;
|
|
|
|
+
|
|
|
|
+ if (RegQueryValueExW( crypt_key, MachineGuidW, NULL, NULL, NULL, NULL ))
|
|
|
|
+ {
|
|
|
|
+ UuidCreate( &uuid );
|
2015-06-11 10:19:47 -07:00
|
|
|
+ wsprintfW( buffer, formatW, uuid.Data1, uuid.Data2, uuid.Data3,
|
|
|
|
+ uuid.Data4[0], uuid.Data4[1], uuid.Data4[2], uuid.Data4[3],
|
|
|
|
+ uuid.Data4[4], uuid.Data4[5], uuid.Data4[6], uuid.Data4[7] );
|
2015-05-03 09:52:56 -07:00
|
|
|
+ RegSetValueExW( crypt_key, MachineGuidW, 0, REG_SZ, (BYTE *)buffer, sizeof(buffer) );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RegCloseKey( crypt_key );
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static void create_volatile_environment_registry_key(void)
|
|
|
|
{
|
|
|
|
static const WCHAR VolatileEnvW[] = {'V','o','l','a','t','i','l','e',' ','E','n','v','i','r','o','n','m','e','n','t',0};
|
2015-06-11 10:19:47 -07:00
|
|
|
@@ -1236,6 +1268,7 @@ int main( int argc, char *argv[] )
|
2015-05-03 09:52:56 -07:00
|
|
|
create_hardware_registry_keys();
|
|
|
|
create_dynamic_registry_keys();
|
|
|
|
create_environment_registry_keys();
|
|
|
|
+ create_cryptography_registry_keys();
|
|
|
|
wininit();
|
|
|
|
pendingRename();
|
|
|
|
|
|
|
|
--
|
2015-06-11 10:19:47 -07:00
|
|
|
2.4.2
|
2015-05-03 09:52:56 -07:00
|
|
|
|