- /* FIXME: Encrypt the password */
- lpEncryptedPassword = (LPBYTE)lpPassword;
- dwPasswordLength = (DWORD)(lpPassword ? (strlen(lpPassword) + 1) * sizeof(CHAR) : 0);
+ if (lpPassword != NULL)
+ {
+ /* Convert the password to unicode */
+ lpPasswordW = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ (strlen(lpPassword) + 1) * sizeof(WCHAR));
+ if (lpPasswordW == NULL)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+
+ MultiByteToWideChar(CP_ACP,
+ 0,
+ lpPassword,
+ -1,
+ lpPasswordW,
+ (int)(strlen(lpPassword) + 1));
+
+ /* FIXME: Encrypt the password */
+ lpEncryptedPassword = (LPBYTE)lpPasswordW;
+ dwPasswordLength = (wcslen(lpPasswordW) + 1) * sizeof(WCHAR);
+ }