Juan Lang : crypt32: When formatting a directory name as a multiline string , put a newline between the heading and the value.

Alexandre Julliard julliard at winehq.org
Mon Nov 17 09:14:08 CST 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Nov 14 10:25:40 2008 -0800

crypt32: When formatting a directory name as a multiline string, put a newline between the heading and the value.

---

 dlls/crypt32/crypt32_En.rc |    2 +-
 dlls/crypt32/object.c      |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/crypt32/crypt32_En.rc b/dlls/crypt32/crypt32_En.rc
index 5744d5c..1f6876b 100644
--- a/dlls/crypt32/crypt32_En.rc
+++ b/dlls/crypt32/crypt32_En.rc
@@ -181,7 +181,7 @@ STRINGTABLE DISCARDABLE
     IDS_ALT_NAME_OTHER_NAME "Other Name="
     IDS_ALT_NAME_RFC822_NAME "Email Address="
     IDS_ALT_NAME_DNS_NAME "DNS Name="
-    IDS_ALT_NAME_DIRECTORY_NAME "Directory Name="
+    IDS_ALT_NAME_DIRECTORY_NAME "Directory Address"
     IDS_ALT_NAME_URL "URL="
     IDS_ALT_NAME_IP_ADDRESS "IP Address="
     IDS_ALT_NAME_MASK "Mask="
diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index 0bbc6a3..eb19ed4 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -751,6 +751,7 @@ static BOOL CRYPT_FormatCertSerialNumber(CRYPT_DATA_BLOB *serialNum, LPWSTR str,
 }
 
 static const WCHAR indent[] = { ' ',' ',' ',' ',' ',0 };
+static const WCHAR colonCrlf[] = { ':','\r','\n',0 };
 
 static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
  CERT_ALT_NAME_ENTRY *entry, LPWSTR str, DWORD *pcbStr)
@@ -790,6 +791,10 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
         LoadStringW(hInstance, IDS_ALT_NAME_DIRECTORY_NAME, buf,
          sizeof(buf) / sizeof(buf[0]));
         bytesNeeded += (directoryNameLen - 1) * sizeof(WCHAR);
+        if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
+            bytesNeeded += strlenW(colonCrlf) * sizeof(WCHAR);
+        else
+            bytesNeeded += sizeof(WCHAR); /* '=' */
         ret = TRUE;
         break;
     }
@@ -893,6 +898,13 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel,
                 strcpyW(str, entry->u.pwszURL);
                 break;
             case CERT_ALT_NAME_DIRECTORY_NAME:
+                if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
+                {
+                    strcpyW(str, colonCrlf);
+                    str += strlenW(colonCrlf);
+                }
+                else
+                    *str++ = '=';
                 cert_name_to_str_with_indent(X509_ASN_ENCODING,
                  indentLevel + 1, &entry->u.DirectoryName, strType, str,
                  bytesNeeded / sizeof(WCHAR));
@@ -988,7 +1000,6 @@ static BOOL CRYPT_FormatAltNameInfo(DWORD dwFormatStrType, DWORD indentLevel,
     return ret;
 }
 
-static const WCHAR colonCrlf[] = { ':','\r','\n',0 };
 static const WCHAR colonSep[] = { ':',' ',0 };
 
 static BOOL CRYPT_FormatCertIssuer(DWORD dwFormatStrType,




More information about the wine-cvs mailing list