if (This->pPidl)
ILFree(This->pPidl);
- LocalFree((HANDLE)This);
+ LocalFree(This);
return 0;
}
{
TRACE("%p %p\n", This, pclsid);
- memcpy( pclsid, &CLSID_ShellLink, sizeof (CLSID) );
+ *pclsid = CLSID_ShellLink;
return S_OK;
}
/* convert to unicode if necessary */
if( !unicode )
{
- count = MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, NULL, 0 );
+ count = MultiByteToWideChar( CP_ACP, 0, temp, len, NULL, 0 );
str = HeapAlloc( GetProcessHeap(), 0, (count+1)*sizeof (WCHAR) );
if( !str )
{
HeapFree( GetProcessHeap(), 0, temp );
return E_OUTOFMEMORY;
}
- MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, str, count );
+ MultiByteToWideChar( CP_ACP, 0, temp, len, str, count );
HeapFree( GetProcessHeap(), 0, temp );
}
else
{
count /= 2;
- str = (LPWSTR) temp;
+ str = temp;
}
str[count] = 0;
TRACE("Read %d bytes\n",chunk->size);
- *data = (LPVOID) chunk;
+ *data = chunk;
return S_OK;
}
char *p = NULL;
LOCATION_INFO *loc;
HRESULT r;
- int n;
+ DWORD n;
r = Stream_ReadChunk( stm, (LPVOID*) &p );
if( FAILED(r) )
TRACE("%p\n",stm);
- r = IStream_Read( stm, &buffer.cbSize, sizeof (DWORD), &count );
+ r = IStream_Read( stm, &buffer.dbh.cbSize, sizeof (DWORD), &count );
if( FAILED( r ) )
return r;
/* make sure that we read the size of the structure even on error */
size = sizeof buffer - sizeof (DWORD);
- if( buffer.cbSize != sizeof buffer )
+ if( buffer.dbh.cbSize != sizeof buffer )
{
ERR("Ooops. This structure is not as expected...\n");
return E_FAIL;
}
- r = IStream_Read( stm, &buffer.dwSignature, size, &count );
+ r = IStream_Read( stm, &buffer.dbh.dwSignature, size, &count );
if( FAILED( r ) )
return r;
if( count != size )
return E_FAIL;
- TRACE("magic %08x string = %s\n", buffer.dwSignature, debugstr_w(buffer.szwDarwinID));
+ TRACE("magic %08x string = %s\n", buffer.dbh.dwSignature, debugstr_w(buffer.szwDarwinID));
- if( (buffer.dwSignature&0xffff0000) != 0xa0000000 )
+ if( (buffer.dbh.dwSignature&0xffff0000) != 0xa0000000 )
{
- ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dwSignature);
+ ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dbh.dwSignature);
return E_FAIL;
}
EXP_DARWIN_LINK *buffer;
buffer = LocalAlloc( LMEM_ZEROINIT, sizeof *buffer );
- buffer->cbSize = sizeof *buffer;
- buffer->dwSignature = magic;
+ buffer->dbh.cbSize = sizeof *buffer;
+ buffer->dbh.dwSignature = magic;
lstrcpynW( buffer->szwDarwinID, string, MAX_PATH );
WideCharToMultiByte(CP_ACP, 0, string, -1, buffer->szDarwinID, MAX_PATH, NULL, NULL );
buffer = shelllink_build_darwinid( string, magic );
- return IStream_Write( stm, buffer, buffer->cbSize, &count );
+ return IStream_Write( stm, buffer, buffer->dbh.cbSize, &count );
}
/************************************************************************
memset(&header, 0, sizeof(header));
header.dwSize = sizeof(header);
header.fStartup = This->iShowCmd;
- memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) );
+ header.MagicGuid = CLSID_ShellLink;
header.wHotKey = This->wHotKey;
header.nIcon = This->iIcoNdx;
hr = E_FAIL;
if (SUCCEEDED(hr))
- *ppv = (IUnknown*) psl;
+ *ppv = psl;
IPersistFile_Release(ppf);
}
if (SUCCEEDED(hr)) {
IExtractIconA* pei;
- hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei);
+ hr = IShellFolder_GetUIObjectOf(psf, 0, 1, &pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei);
if (SUCCEEDED(hr)) {
- hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL);
+ hr = IExtractIconA_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL);
- pei->lpVtbl->Release(pei);
+ IExtractIconA_Release(pei);
}
IShellFolder_Release(psf);
TRACE("(%p)->(path=%s)\n",This, pszFile);
+ if (!pszFile) return E_INVALIDARG;
+
str = HEAP_strdupAtoW(GetProcessHeap(), 0, pszFile);
if( !str )
return E_OUTOFMEMORY;
if (SUCCEEDED(hr)) {
IExtractIconW* pei;
- hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei);
+ hr = IShellFolder_GetUIObjectOf(psf, 0, 1, &pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei);
if (SUCCEEDED(hr)) {
- hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags);
+ hr = IExtractIconW_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags);
- pei->lpVtbl->Release(pei);
+ IExtractIconW_Release(pei);
}
IShellFolder_Release(psf);
TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
+ if (!pszFile) return E_INVALIDARG;
+
/* quotes at the ends of the string are stripped */
len = wcslen(pszFile);
if (pszFile[0] == '"' && pszFile[len-1] == '"')
/* any other quote marks are invalid */
if (wcschr(pszFile, '"'))
+ {
+ HeapFree(GetProcessHeap(), 0, unquoted);
return S_FALSE;
+ }
HeapFree(GetProcessHeap(), 0, This->sPath);
This->sPath = NULL;
case 14021:
if (This->sIcoPath)
wcscpy(szBuffer, This->sIcoPath);
+ else
+ wcscpy(szBuffer, This->sPath);
+
IconIndex = This->iIcoNdx;
if (PickIconDlg(hwndDlg, szBuffer, MAX_PATH, &IconIndex))
{
wcscat( args, iciex->lpParametersW );
}
}
+ else if (This->sArgs != NULL)
+ {
+ args = strdupW( This->sArgs );
+ }
memset( &sei, 0, sizeof sei );
sei.cbSize = sizeof sei;