EA Durbin : kernel32: Partially implement GetUserGeoID().

Alexandre Julliard julliard at winehq.org
Thu Oct 18 07:59:41 CDT 2007


Module: wine
Branch: master
Commit: 9984ac8a12e0d78ca9cfa33db7340ff1a8e60f71
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9984ac8a12e0d78ca9cfa33db7340ff1a8e60f71

Author: EA Durbin <ead1234 at hotmail.com>
Date:   Tue Oct 16 21:06:46 2007 -0500

kernel32: Partially implement GetUserGeoID().

---

 dlls/kernel32/locale.c |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 6624f81..1ecda49 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -3500,8 +3500,36 @@ BOOL WINAPI InvalidateNLSCache(void)
  */
 GEOID WINAPI GetUserGeoID( GEOCLASS GeoClass )
 {
-    FIXME("%d\n",GeoClass);
-    return GEOID_NOT_AVAILABLE;
+    GEOID ret = GEOID_NOT_AVAILABLE;
+    static const WCHAR geoW[] = {'G','e','o',0};
+    static const WCHAR nationW[] = {'N','a','t','i','o','n',0};
+    WCHAR bufferW[40], *end;
+    DWORD count;
+    HANDLE hkey, hSubkey = 0;
+    UNICODE_STRING keyW;
+    const KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)bufferW;
+    RtlInitUnicodeString( &keyW, nationW );
+    count = sizeof(bufferW);
+
+    if(!(hkey = create_registry_key())) return ret;
+
+    switch( GeoClass ){
+    case GEOCLASS_NATION:
+        if ((hSubkey = NLS_RegOpenKey(hkey, geoW)))
+        {
+            if((NtQueryValueKey(hSubkey, &keyW, KeyValuePartialInformation,
+                                (LPBYTE)bufferW, count, &count) == STATUS_SUCCESS ) && info->DataLength)
+                ret = strtolW((LPCWSTR)info->Data, &end, 10);
+        }
+        break;
+    case GEOCLASS_REGION:
+        FIXME("GEOCLASS_REGION not handled yet\n");
+        break;
+    }
+
+    NtClose(hkey);
+    if (hSubkey) NtClose(hSubkey);
+    return ret;
 }
 
 /******************************************************************************




More information about the wine-cvs mailing list