Alexander Nicolaysen Sørnes : crypt32: Implement CryptFindLocalizedName.

Alexandre Julliard julliard at winehq.org
Tue Jan 8 10:21:46 CST 2008


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

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Sun Jan  6 17:02:33 2008 +0100

crypt32: Implement CryptFindLocalizedName.

---

 dlls/crypt32/crypt32_En.rc |    8 ++++++++
 dlls/crypt32/crypt32_No.rc |    8 ++++++++
 dlls/crypt32/cryptres.h    |    5 +++++
 dlls/crypt32/oid.c         |   30 +++++++++++++++++++++++++++++-
 4 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/dlls/crypt32/crypt32_En.rc b/dlls/crypt32/crypt32_En.rc
index 08bf385..38e3b2e 100644
--- a/dlls/crypt32/crypt32_En.rc
+++ b/dlls/crypt32/crypt32_En.rc
@@ -164,3 +164,11 @@ STRINGTABLE DISCARDABLE
     IDS_LIFETIME_SIGNING "Lifetime Signing"
     IDS_ANY_CERT_POLICY "All issuance policies"
 }
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALIZEDNAME_ROOT "Trusted Root Certification Authorities"
+    IDS_LOCALIZEDNAME_MY "Personal"
+    IDS_LOCALIZEDNAME_CA "Intermediate Certification Authorities"
+    IDS_LOCALIZEDNAME_ADDRESSBOOK "Other People"
+}
diff --git a/dlls/crypt32/crypt32_No.rc b/dlls/crypt32/crypt32_No.rc
index 6d5bb82..18de84b 100644
--- a/dlls/crypt32/crypt32_No.rc
+++ b/dlls/crypt32/crypt32_No.rc
@@ -164,3 +164,11 @@ STRINGTABLE DISCARDABLE
     IDS_LIFETIME_SIGNING "Livstidsignering"
     IDS_ANY_CERT_POLICY "Alle framgangsmåter for utsteding"
 }
+
+STRINGTABLE DISCARDABLE
+{
+    IDS_LOCALIZEDNAME_ROOT "Klarerte rotsertifiseringsinstanser"
+    IDS_LOCALIZEDNAME_MY "Personlig"
+    IDS_LOCALIZEDNAME_CA "Mellomliggende sertifiseringsinstanser"
+    IDS_LOCALIZEDNAME_ADDRESSBOOK "Andre personer"
+}
diff --git a/dlls/crypt32/cryptres.h b/dlls/crypt32/cryptres.h
index 1f0a95e..32c8169 100644
--- a/dlls/crypt32/cryptres.h
+++ b/dlls/crypt32/cryptres.h
@@ -160,4 +160,9 @@
 #define IDS_LIFETIME_SIGNING 1139
 #define IDS_ANY_CERT_POLICY 1140
 
+#define IDS_LOCALIZEDNAME_ROOT 1141
+#define IDS_LOCALIZEDNAME_MY 1142
+#define IDS_LOCALIZEDNAME_CA 1143
+#define IDS_LOCALIZEDNAME_ADDRESSBOOK 1144
+
 #endif /* ndef __WINE_CRYPTRES_H__ */
diff --git a/dlls/crypt32/oid.c b/dlls/crypt32/oid.c
index c35554f..5d17997 100644
--- a/dlls/crypt32/oid.c
+++ b/dlls/crypt32/oid.c
@@ -77,6 +77,13 @@ struct OIDFunction
     struct list next;
 };
 
+static const WCHAR ROOT[] = {'R','O','O','T',0};
+static const WCHAR MY[] = {'M','Y',0};
+static const WCHAR CA[] = {'C','A',0};
+static const WCHAR ADDRESSBOOK[] = {'A','D','D','R','E','S','S','B','O','O','K',0};
+static const LPCWSTR LocalizedKeys[] = {ROOT,MY,CA,ADDRESSBOOK};
+static WCHAR LocalizedNames[4][256];
+
 static void free_function_sets(void)
 {
     struct OIDFunctionSet *setCursor, *setNext;
@@ -987,12 +994,32 @@ BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType,
     return ret;
 }
 
+static void oid_init_localizednames(HINSTANCE hInstance)
+{
+    int i;
+
+    for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
+    {
+        LoadStringW(hInstance, IDS_LOCALIZEDNAME_ROOT+i, LocalizedNames[i], 256);
+    }
+}
+
 /********************************************************************
  *              CryptFindLocalizedName (CRYPT32.@)
  */
 LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName)
 {
-    FIXME(" %s - stub\n",debugstr_w(pwszCryptName));
+    int i;
+
+    for(i = 0; i < sizeof(LocalizedKeys)/sizeof(LPCWSTR); i++)
+    {
+        if(!lstrcmpiW(LocalizedKeys[i], pwszCryptName))
+        {
+            return LocalizedNames[i];
+        }
+    }
+
+    FIXME("No name for: %s - stub\n",debugstr_w(pwszCryptName));
     return NULL;
 }
 
@@ -1345,6 +1372,7 @@ static void init_oid_info(HINSTANCE hinst)
 {
     DWORD i;
 
+    oid_init_localizednames(hinst);
     for (i = 0; i < sizeof(oidInfoConstructors) /
      sizeof(oidInfoConstructors[0]); i++)
     {




More information about the wine-cvs mailing list