Commit a9a04e8d authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

- make drive letters in PIDLs always uppercase to enable PIDL

comparison - Unicodify _ILCreateDrive()
parent 675855d4
......@@ -1633,16 +1633,16 @@ HRESULT _ILCreateFromPathA(LPCSTR szPath, LPITEMIDLIST* ppidl)
return S_OK;
}
LPITEMIDLIST _ILCreateDrive( LPCSTR lpszNew)
LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
{
char sTemp[4];
WCHAR sTemp[4];
LPITEMIDLIST pidlOut;
sTemp[0]=lpszNew[0];
sTemp[0]=toupperW(lpszNew[0]);
sTemp[1]=':';
sTemp[2]='\\';
sTemp[3]=0x00;
TRACE("(%s)\n",sTemp);
TRACE("(%s)\n",debugstr_w(sTemp));
if ((pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct))))
{
......@@ -1650,7 +1650,7 @@ LPITEMIDLIST _ILCreateDrive( LPCSTR lpszNew)
if ((pszDest = _ILGetTextPointer(pidlOut)))
{
memcpy(pszDest, sTemp, sizeof(sTemp));
WideCharToMultiByte(CP_ACP, 0, sTemp, sizeof(sTemp)/sizeof(WCHAR), pszDest, sizeof(sTemp)/sizeof(WCHAR), NULL, NULL);
TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
}
}
......
......@@ -220,7 +220,7 @@ LPITEMIDLIST _ILCreateControlPanel (void);
LPITEMIDLIST _ILCreatePrinters (void);
LPITEMIDLIST _ILCreateNetwork (void);
LPITEMIDLIST _ILCreateBitBucket (void);
LPITEMIDLIST _ILCreateDrive (LPCSTR);
LPITEMIDLIST _ILCreateDrive (LPCWSTR);
/*
* helper functions (getting struct-pointer)
......
......@@ -196,7 +196,6 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH];
CHAR szTempA[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL;
CLSID clsid;
......@@ -217,8 +216,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
/* do we have an absolute path name ? */
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
WideCharToMultiByte (CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL);
pidlTemp = _ILCreateDrive (szTempA);
pidlTemp = _ILCreateDrive (szElement);
}
if (szNext && *szNext) {
......@@ -249,15 +247,15 @@ static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
/*enumerate the folders*/
if(dwFlags & SHCONTF_FOLDERS)
{
CHAR szDriveName[] = "A:\\";
WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
DWORD dwDrivemap = GetLogicalDrives();
HKEY hkey;
while (ret && szDriveName[0]<='Z')
while (ret && wszDriveName[0]<='Z')
{
if(dwDrivemap & 0x00000001L)
ret = AddToEnumList(list, _ILCreateDrive(szDriveName));
szDriveName[0]++;
ret = AddToEnumList(list, _ILCreateDrive(wszDriveName));
wszDriveName[0]++;
dwDrivemap = dwDrivemap >> 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment