+ /* Build a Unicode argument vector */
+ if (argc > 0)
+ {
+ lpVector = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ argc * sizeof(LPWSTR));
+ if (lpVector == NULL)
+ return ERROR_NOT_ENOUGH_MEMORY;
+
+ for (i = 0; i < argc; i++)
+ {
+ dwLength = MultiByteToWideChar(CP_ACP,
+ 0,
+ ((LPSTR*)argv)[i],
+ -1,
+ NULL,
+ 0);
+
+ lpVector[i] = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ dwLength * sizeof(WCHAR));
+ if (lpVector[i] == NULL)
+ {
+ dwError = ERROR_NOT_ENOUGH_MEMORY;
+ goto done;
+ }
+
+ MultiByteToWideChar(CP_ACP,
+ 0,
+ ((LPSTR*)argv)[i],
+ -1,
+ lpVector[i],
+ dwLength);
+ }
+ }