Commit b7de2660 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

shell32: Remove superfluous casts; mostly of void pointers.

parent d7c0cbdc
...@@ -638,7 +638,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -638,7 +638,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
switch (uMsg) { switch (uMsg) {
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam); sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam);
SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0); SendMessageW(hwnd, LB_SETCURSEL, sel, 0);
break; break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0); sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
......
...@@ -813,7 +813,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, ...@@ -813,7 +813,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
if (msg == WM_INITDIALOG) if (msg == WM_INITDIALOG)
return BrsFolder_OnCreate( hWnd, (browse_info*) lParam ); return BrsFolder_OnCreate( hWnd, (browse_info*) lParam );
info = (browse_info*) GetPropW( hWnd, szBrowseFolderInfo ); info = GetPropW( hWnd, szBrowseFolderInfo );
switch (msg) switch (msg)
{ {
......
...@@ -88,7 +88,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) ...@@ -88,7 +88,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size); hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal; if(!hGlobal) return hGlobal;
pDropFiles = (DROPFILES *)GlobalLock(hGlobal); pDropFiles = GlobalLock(hGlobal);
offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR); offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
pDropFiles->pFiles = offset * sizeof(WCHAR); pDropFiles->pFiles = offset * sizeof(WCHAR);
pDropFiles->fWide = TRUE; pDropFiles->fWide = TRUE;
...@@ -194,7 +194,7 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) ...@@ -194,7 +194,7 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
/* fill the structure */ /* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size); hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal; if(!hGlobal) return hGlobal;
szFileName = (char *)GlobalLock(hGlobal); szFileName = GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size); memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal); GlobalUnlock(hGlobal);
...@@ -226,7 +226,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) ...@@ -226,7 +226,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
/* fill the structure */ /* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size); hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal; if(!hGlobal) return hGlobal;
szFileName = (WCHAR *)GlobalLock(hGlobal); szFileName = GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size); memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal); GlobalUnlock(hGlobal);
...@@ -242,7 +242,7 @@ HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags) ...@@ -242,7 +242,7 @@ HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD)); hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
if(!hGlobal) return hGlobal; if(!hGlobal) return hGlobal;
pdwFlag = (DWORD*)GlobalLock(hGlobal); pdwFlag = GlobalLock(hGlobal);
*pdwFlag = dwFlags; *pdwFlag = dwFlags;
GlobalUnlock(hGlobal); GlobalUnlock(hGlobal);
return hGlobal; return hGlobal;
......
...@@ -131,7 +131,7 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOI ...@@ -131,7 +131,7 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOI
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown)) if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
sf = (ICPanelImpl *) LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl)); sf = LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl));
if (!sf) if (!sf)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -71,7 +71,7 @@ HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, ...@@ -71,7 +71,7 @@ HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid,
if (pUnkOuter) if (pUnkOuter)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
dth = (IDropTargetHelperImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IDropTargetHelperImpl)); dth = LocalAlloc (LMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
if (!dth) return E_OUTOFMEMORY; if (!dth) return E_OUTOFMEMORY;
dth->ref = 0; dth->ref = 0;
......
...@@ -71,7 +71,7 @@ BOOL AddToEnumList( ...@@ -71,7 +71,7 @@ BOOL AddToEnumList(
if (!iface || !pidl) if (!iface || !pidl)
return FALSE; return FALSE;
pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST)); pNew = SHAlloc(sizeof(ENUMLIST));
if(pNew) if(pNew)
{ {
/*set the next pointer */ /*set the next pointer */
......
...@@ -260,7 +260,7 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI ...@@ -260,7 +260,7 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon); TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY)); lpsice = SHAlloc(sizeof(SIC_ENTRY));
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL); GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) ); lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) );
...@@ -413,9 +413,9 @@ BOOL SIC_Initialize(void) ...@@ -413,9 +413,9 @@ BOOL SIC_Initialize(void)
ImageList_SetBkColor(ShellBigIconList, CLR_NONE); ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
/* Load the document icon, which is used as the default if an icon isn't found. */ /* Load the document icon, which is used as the default if an icon isn't found. */
hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_small, cy_small, LR_SHARED); IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_large, cy_large, LR_SHARED); IMAGE_ICON, cx_large, cy_large, LR_SHARED);
if (!hSm || !hLg) if (!hSm || !hLg)
......
...@@ -232,7 +232,7 @@ LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl) ...@@ -232,7 +232,7 @@ LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl)
return NULL; return NULL;
len = ILGetSize(pidl); len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)SHAlloc(len); newpidl = SHAlloc(len);
if (newpidl) if (newpidl)
memcpy(newpidl,pidl,len); memcpy(newpidl,pidl,len);
...@@ -259,7 +259,7 @@ LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl) ...@@ -259,7 +259,7 @@ LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
if (pidl) if (pidl)
{ {
len = pidl->mkid.cb; len = pidl->mkid.cb;
pidlNew = (LPITEMIDLIST) SHAlloc (len+2); pidlNew = SHAlloc(len+2);
if (pidlNew) if (pidlNew)
{ {
memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */ memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */
...@@ -464,7 +464,7 @@ LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl) ...@@ -464,7 +464,7 @@ LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl)
return NULL; return NULL;
len = ILGetSize(pidl); len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)Alloc(len); newpidl = Alloc(len);
if (newpidl) if (newpidl)
memcpy(newpidl,pidl,len); memcpy(newpidl,pidl,len);
...@@ -725,7 +725,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM ...@@ -725,7 +725,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
/*assert(pida->cidl==1);*/ /*assert(pida->cidl==1);*/
LPIDA pida = (LPIDA)GlobalLock(medium.u.hGlobal); LPIDA pida = GlobalLock(medium.u.hGlobal);
LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]); LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]); LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
......
...@@ -198,7 +198,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, ...@@ -198,7 +198,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
return 0; return 0;
hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n); hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n);
RetPtr = (HICON16*)GlobalLock16(hRet); RetPtr = GlobalLock16(hRet);
if (nIconIndex == (UINT16)-1) /* get number of icons */ if (nIconIndex == (UINT16)-1) /* get number of icons */
{ {
......
...@@ -548,7 +548,7 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p) ...@@ -548,7 +548,7 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
TRACE("\n"); TRACE("\n");
lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); lpDropFileStruct = GlobalLock(hDrop);
*p = lpDropFileStruct->pt; *p = lpDropFileStruct->pt;
bRet = lpDropFileStruct->fNC; bRet = lpDropFileStruct->fNC;
...@@ -569,7 +569,7 @@ UINT WINAPI DragQueryFileA( ...@@ -569,7 +569,7 @@ UINT WINAPI DragQueryFileA(
{ {
LPSTR lpDrop; LPSTR lpDrop;
UINT i = 0; UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength); TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
...@@ -624,7 +624,7 @@ UINT WINAPI DragQueryFileW( ...@@ -624,7 +624,7 @@ UINT WINAPI DragQueryFileW(
{ {
LPWSTR lpwDrop; LPWSTR lpwDrop;
UINT i = 0; UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength); TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
......
...@@ -1641,7 +1641,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ ...@@ -1641,7 +1641,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_
if (lRet == ERROR_SUCCESS) if (lRet == ERROR_SUCCESS)
{ {
/* Create and initialize the Property Sheet Extensions Array */ /* Create and initialize the Property Sheet Extensions Array */
psxa = (PPSXA)LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface])); psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
if (psxa) if (psxa)
{ {
ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface])); ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));
......
...@@ -242,7 +242,7 @@ DWORD WINAPI CheckEscapesA( ...@@ -242,7 +242,7 @@ DWORD WINAPI CheckEscapesA(
DWORD ret = 0; DWORD ret = 0;
TRACE("(%s %d)\n", debugstr_a(string), len); TRACE("(%s %d)\n", debugstr_a(string), len);
wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR)); wString = LocalAlloc(LPTR, len * sizeof(WCHAR));
if (wString) if (wString)
{ {
MultiByteToWideChar(CP_ACP, 0, string, len, wString, len); MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
......
...@@ -235,7 +235,7 @@ IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) ...@@ -235,7 +235,7 @@ IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown)) if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
sf = (IGenericSFImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl)); sf = LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf) if (!sf)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -94,7 +94,7 @@ HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, ...@@ -94,7 +94,7 @@ HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid,
if (pUnkOuter) if (pUnkOuter)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
sf = (IGenericSFImpl *) HeapAlloc ( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl)); sf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
if (!sf) if (!sf)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -614,7 +614,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L ...@@ -614,7 +614,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L
/* Special case for the root folder. */ /* Special case for the root folder. */
if (!strcmp(szCompletePath, "/")) { if (!strcmp(szCompletePath, "/")) {
*ppidl = pidl = (LPITEMIDLIST)SHAlloc(sizeof(USHORT)); *ppidl = pidl = SHAlloc(sizeof(USHORT));
if (!pidl) return E_FAIL; if (!pidl) return E_FAIL;
pidl->mkid.cb = 0; /* Terminate the ITEMIDLIST */ pidl->mkid.cb = 0; /* Terminate the ITEMIDLIST */
return S_OK; return S_OK;
...@@ -657,7 +657,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L ...@@ -657,7 +657,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L
SHFree(pszAPath); SHFree(pszAPath);
SHFree(pwszPath); SHFree(pwszPath);
*ppidl = pidl = (LPITEMIDLIST)SHAlloc(cPidlLen); *ppidl = pidl = SHAlloc(cPidlLen);
if (!pidl) return E_FAIL; if (!pidl) return E_FAIL;
/* Concatenate the SHITEMIDs of the sub-directories. */ /* Concatenate the SHITEMIDs of the sub-directories. */
...@@ -2342,7 +2342,7 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Skip(IEnumIDList* iface, ...@@ -2342,7 +2342,7 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Skip(IEnumIDList* iface,
TRACE("(iface=%p, celt=%d)\n", iface, celt); TRACE("(iface=%p, celt=%d)\n", iface, celt);
/* Call IEnumIDList::Next and delete the resulting pidls. */ /* Call IEnumIDList::Next and delete the resulting pidls. */
apidl = (LPITEMIDLIST*)SHAlloc(celt * sizeof(LPITEMIDLIST)); apidl = SHAlloc(celt * sizeof(LPITEMIDLIST));
hr = IEnumIDList_Next(iface, celt, apidl, &cFetched); hr = IEnumIDList_Next(iface, celt, apidl, &cFetched);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
while (cFetched--) while (cFetched--)
......
...@@ -330,7 +330,7 @@ static BOOL FileMenu_AppendItemW( ...@@ -330,7 +330,7 @@ static BOOL FileMenu_AppendItemW(
if (lpText != FM_SEPARATOR) if (lpText != FM_SEPARATOR)
{ {
int len = strlenW (lpText); int len = strlenW (lpText);
myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len*sizeof(WCHAR)); myItem = SHAlloc(sizeof(FMITEM) + len*sizeof(WCHAR));
strcpyW (myItem->szItemText, lpText); strcpyW (myItem->szItemText, lpText);
myItem->cchItemText = len; myItem->cchItemText = len;
myItem->iIconIndex = icon; myItem->iIconIndex = icon;
......
...@@ -837,7 +837,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This) ...@@ -837,7 +837,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
SHFree(This->apidl); SHFree(This->apidl);
This->cidl = ListView_GetSelectedCount(This->hWndList); This->cidl = ListView_GetSelectedCount(This->hWndList);
This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST)); This->apidl = SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
TRACE("selected=%i\n", This->cidl); TRACE("selected=%i\n", This->cidl);
......
...@@ -292,7 +292,7 @@ static BOOL DoPaste( ...@@ -292,7 +292,7 @@ static BOOL DoPaste(
if(hMem) if(hMem)
{ {
char * pDropFiles = (char *)GlobalLock(hMem); char * pDropFiles = GlobalLock(hMem);
if(pDropFiles) if(pDropFiles)
{ {
int len, offset = sizeof(DROPFILESTRUCT); int len, offset = sizeof(DROPFILESTRUCT);
......
...@@ -37,7 +37,7 @@ static HRESULT (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST ...@@ -37,7 +37,7 @@ static HRESULT (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST
static WCHAR *CoDupStrW(const char* src) static WCHAR *CoDupStrW(const char* src)
{ {
INT len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); INT len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
WCHAR* szTemp = (WCHAR*)CoTaskMemAlloc(len * sizeof(WCHAR)); WCHAR* szTemp = CoTaskMemAlloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, src, -1, szTemp, len); MultiByteToWideChar(CP_ACP, 0, src, -1, szTemp, len);
return szTemp; return szTemp;
} }
......
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