EA Durbin : kernel32: Implement SetUserGeoID.
Alexandre Julliard
julliard at winehq.org
Wed Oct 10 06:46:12 CDT 2007
Module: wine
Branch: master
Commit: 64dda7f3175a380d8e7d85012f08e4665f261f64
URL: http://source.winehq.org/git/wine.git/?a=commit;h=64dda7f3175a380d8e7d85012f08e4665f261f64
Author: EA Durbin <ead1234 at hotmail.com>
Date: Sat Oct 6 23:56:49 2007 -0500
kernel32: Implement SetUserGeoID.
---
dlls/kernel32/locale.c | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 8a62991..73ca344 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -3508,8 +3508,37 @@ GEOID WINAPI GetUserGeoID( GEOCLASS GeoClass )
*/
BOOL WINAPI SetUserGeoID( GEOID GeoID )
{
- FIXME("%d\n",GeoID);
- return FALSE;
+ static const WCHAR geoW[] = {'G','e','o',0};
+ static const WCHAR nationW[] = {'N','a','t','i','o','n',0};
+ static const WCHAR formatW[] = {'%','i',0};
+ UNICODE_STRING nameW,keyW;
+ WCHAR bufferW[10];
+ OBJECT_ATTRIBUTES attr;
+ HANDLE hkey;
+
+ if(!(hkey = create_registry_key())) return FALSE;
+
+ attr.Length = sizeof(attr);
+ attr.RootDirectory = hkey;
+ attr.ObjectName = &nameW;
+ attr.Attributes = 0;
+ attr.SecurityDescriptor = NULL;
+ attr.SecurityQualityOfService = NULL;
+ RtlInitUnicodeString( &nameW, geoW );
+ RtlInitUnicodeString( &keyW, nationW );
+
+ if (NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ) != STATUS_SUCCESS)
+
+ {
+ NtClose(attr.RootDirectory);
+ return FALSE;
+ }
+
+ sprintfW(bufferW, formatW, GeoID);
+ NtSetValueKey(hkey, &keyW, 0, REG_SZ, bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR));
+ NtClose(attr.RootDirectory);
+ NtClose(hkey);
+ return TRUE;
}
typedef struct
More information about the wine-cvs
mailing list