Reindent some code to improve readability.
This commit is contained in:
parent
b24193c344
commit
af882e0e41
|
@ -92,15 +92,18 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
LPWSTR cmdline;
|
||||
int in_quotes,bcount;
|
||||
|
||||
if (*lpCmdline==0) {
|
||||
if (*lpCmdline==0)
|
||||
{
|
||||
/* Return the path to the executable */
|
||||
DWORD len, size=16;
|
||||
|
||||
hargv=GlobalAlloc(size, 0);
|
||||
argv=GlobalLock(hargv);
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
len = GetModuleFileNameW(0, (LPWSTR)(argv+1), size-sizeof(LPWSTR));
|
||||
if (!len) {
|
||||
if (!len)
|
||||
{
|
||||
GlobalFree(hargv);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -121,8 +124,10 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
bcount=0;
|
||||
in_quotes=0;
|
||||
cs=lpCmdline;
|
||||
while (1) {
|
||||
if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes)) {
|
||||
while (1)
|
||||
{
|
||||
if (*cs==0 || ((*cs==0x0009 || *cs==0x0020) && !in_quotes))
|
||||
{
|
||||
/* space */
|
||||
argc++;
|
||||
/* skip the remaining spaces */
|
||||
|
@ -133,14 +138,20 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
break;
|
||||
bcount=0;
|
||||
continue;
|
||||
} else if (*cs==0x005c) {
|
||||
}
|
||||
else if (*cs==0x005c)
|
||||
{
|
||||
/* '\', count them */
|
||||
bcount++;
|
||||
} else if ((*cs==0x0022) && ((bcount & 1)==0)) {
|
||||
}
|
||||
else if ((*cs==0x0022) && ((bcount & 1)==0))
|
||||
{
|
||||
/* unescaped '"' */
|
||||
in_quotes=!in_quotes;
|
||||
bcount=0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a regular character */
|
||||
bcount=0;
|
||||
}
|
||||
|
@ -160,8 +171,10 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
bcount=0;
|
||||
in_quotes=0;
|
||||
arg=d=s=cmdline;
|
||||
while (*s) {
|
||||
if ((*s==0x0009 || *s==0x0020) && !in_quotes) {
|
||||
while (*s)
|
||||
{
|
||||
if ((*s==0x0009 || *s==0x0020) && !in_quotes)
|
||||
{
|
||||
/* Close the argument and copy it */
|
||||
*d=0;
|
||||
argv[argc++]=arg;
|
||||
|
@ -174,20 +187,27 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
/* Start with a new argument */
|
||||
arg=d=s;
|
||||
bcount=0;
|
||||
} else if (*s==0x005c) {
|
||||
}
|
||||
else if (*s==0x005c)
|
||||
{
|
||||
/* '\\' */
|
||||
*d++=*s++;
|
||||
bcount++;
|
||||
} else if (*s==0x0022) {
|
||||
}
|
||||
else if (*s==0x0022)
|
||||
{
|
||||
/* '"' */
|
||||
if ((bcount & 1)==0) {
|
||||
if ((bcount & 1)==0)
|
||||
{
|
||||
/* Preceeded by an even number of '\', this is half that
|
||||
* number of '\', plus a quote which we erase.
|
||||
*/
|
||||
d-=bcount/2;
|
||||
in_quotes=!in_quotes;
|
||||
s++;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Preceeded by an odd number of '\', this is half that
|
||||
* number of '\' followed by a '"'
|
||||
*/
|
||||
|
@ -196,13 +216,16 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
s++;
|
||||
}
|
||||
bcount=0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a regular character */
|
||||
*d++=*s++;
|
||||
bcount=0;
|
||||
}
|
||||
}
|
||||
if (*arg) {
|
||||
if (*arg)
|
||||
{
|
||||
*d='\0';
|
||||
argv[argc++]=arg;
|
||||
}
|
||||
|
@ -223,10 +246,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
|||
* SHGetFileInfoW [SHELL32.@]
|
||||
*
|
||||
*/
|
||||
|
||||
DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||
SHFILEINFOW *psfi, UINT sizeofpsfi,
|
||||
UINT flags )
|
||||
SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags )
|
||||
{
|
||||
WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH];
|
||||
int iIndex;
|
||||
|
@ -241,27 +262,34 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
|
||||
psfi, psfi->dwAttributes, sizeofpsfi, flags);
|
||||
|
||||
if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
|
||||
if ( (flags & SHGFI_USEFILEATTRIBUTES) &&
|
||||
(flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
|
||||
return FALSE;
|
||||
|
||||
/* windows initializes this values regardless of the flags */
|
||||
if (psfi != NULL) {
|
||||
if (psfi != NULL)
|
||||
{
|
||||
psfi->szDisplayName[0] = '\0';
|
||||
psfi->szTypeName[0] = '\0';
|
||||
psfi->iIcon = 0;
|
||||
}
|
||||
|
||||
if (!(flags & SHGFI_PIDL)){
|
||||
if (!(flags & SHGFI_PIDL))
|
||||
{
|
||||
/* SHGitFileInfo should work with absolute and relative paths */
|
||||
if (PathIsRelativeW(path)){
|
||||
if (PathIsRelativeW(path))
|
||||
{
|
||||
GetCurrentDirectoryW(MAX_PATH, szLocation);
|
||||
PathCombineW(szFullPath, szLocation, path);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpynW(szFullPath, path, MAX_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & SHGFI_EXETYPE) {
|
||||
if (flags & SHGFI_EXETYPE)
|
||||
{
|
||||
BOOL status = FALSE;
|
||||
HANDLE hfile;
|
||||
DWORD BinaryType;
|
||||
|
@ -270,18 +298,22 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
DWORD len;
|
||||
char magic[4];
|
||||
|
||||
if (flags != SHGFI_EXETYPE) return 0;
|
||||
if (flags != SHGFI_EXETYPE)
|
||||
return 0;
|
||||
|
||||
status = GetBinaryTypeW (szFullPath, &BinaryType);
|
||||
if (!status) return 0;
|
||||
if ((BinaryType == SCS_DOS_BINARY)
|
||||
|| (BinaryType == SCS_PIF_BINARY)) return 0x4d5a;
|
||||
if (!status)
|
||||
return 0;
|
||||
if ((BinaryType == SCS_DOS_BINARY) || (BinaryType == SCS_PIF_BINARY))
|
||||
return 0x4d5a;
|
||||
|
||||
hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ,
|
||||
NULL, OPEN_EXISTING, 0, 0 );
|
||||
if ( hfile == INVALID_HANDLE_VALUE ) return 0;
|
||||
if ( hfile == INVALID_HANDLE_VALUE )
|
||||
return 0;
|
||||
|
||||
/* The next section is adapted from MODULE_GetBinaryType, as we need
|
||||
/*
|
||||
* The next section is adapted from MODULE_GetBinaryType, as we need
|
||||
* to examine the image header to get OS and version information. We
|
||||
* know from calling GetBinaryTypeA that the image is valid and either
|
||||
* an NE or PE, so much error handling can be omitted.
|
||||
|
@ -298,10 +330,11 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||
ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
|
||||
CloseHandle( hfile );
|
||||
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) {
|
||||
return IMAGE_NT_SIGNATURE
|
||||
| (nt.OptionalHeader.MajorSubsystemVersion << 24)
|
||||
| (nt.OptionalHeader.MinorSubsystemVersion << 16);
|
||||
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
||||
{
|
||||
return IMAGE_NT_SIGNATURE |
|
||||
(nt.OptionalHeader.MajorSubsystemVersion << 24) |
|
||||
(nt.OptionalHeader.MinorSubsystemVersion << 16);
|
||||
}
|
||||
return IMAGE_NT_SIGNATURE;
|
||||
}
|
||||
|
@ -311,35 +344,47 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||
ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
|
||||
CloseHandle( hfile );
|
||||
if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE
|
||||
| (ne.ne_expver << 16);
|
||||
if (ne.ne_exetyp == 2)
|
||||
return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
|
||||
return 0;
|
||||
}
|
||||
CloseHandle( hfile );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* psfi is NULL normally to query EXE type. If it is NULL, none of the
|
||||
* below makes sense anyway. Windows allows this and just returns FALSE */
|
||||
if (psfi == NULL) return FALSE;
|
||||
/*
|
||||
* psfi is NULL normally to query EXE type. If it is NULL, none of the
|
||||
* below makes sense anyway. Windows allows this and just returns FALSE
|
||||
*/
|
||||
if (psfi == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
|
||||
/*
|
||||
* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES
|
||||
* is not specified.
|
||||
The pidl functions fail on not existing file names */
|
||||
* The pidl functions fail on not existing file names
|
||||
*/
|
||||
|
||||
if (flags & SHGFI_PIDL) {
|
||||
if (flags & SHGFI_PIDL)
|
||||
{
|
||||
pidl = ILClone((LPCITEMIDLIST)path);
|
||||
} else if (!(flags & SHGFI_USEFILEATTRIBUTES)) {
|
||||
}
|
||||
else if (!(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes);
|
||||
}
|
||||
|
||||
if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
/* get the parent shellfolder */
|
||||
if (pidl) {
|
||||
hr = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast);
|
||||
if (pidl)
|
||||
{
|
||||
hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
|
||||
(LPCITEMIDLIST*)&pidlLast );
|
||||
ILFree(pidl);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("pidl is null!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -352,7 +397,8 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
psfi->dwAttributes = 0xffffffff;
|
||||
}
|
||||
IShellFolder_GetAttributesOf(psfParent, 1, (LPCITEMIDLIST*)&pidlLast, &(psfi->dwAttributes));
|
||||
IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast,
|
||||
&(psfi->dwAttributes) );
|
||||
}
|
||||
|
||||
/* get the displayname */
|
||||
|
@ -365,7 +411,8 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
STRRET str;
|
||||
hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_INFOLDER, &str);
|
||||
hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast,
|
||||
SHGDN_INFOLDER, &str);
|
||||
StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
|
||||
}
|
||||
}
|
||||
|
@ -375,9 +422,11 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
{
|
||||
static const WCHAR szFile[] = { 'F','i','l','e',0 };
|
||||
static const WCHAR szDashFile[] = { '-','f','i','l','e',0 };
|
||||
|
||||
if (!(flags & SHGFI_USEFILEATTRIBUTES))
|
||||
{
|
||||
char ftype[80];
|
||||
|
||||
_ILGetFileType(pidlLast, ftype, 80);
|
||||
MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 );
|
||||
}
|
||||
|
@ -388,9 +437,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
WCHAR sTemp[64];
|
||||
|
||||
lstrcpyW(sTemp,PathFindExtensionW(szFullPath));
|
||||
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE)
|
||||
&& HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
|
||||
if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) &&
|
||||
HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE )))
|
||||
{
|
||||
lstrcpynW (psfi->szTypeName, sTemp, 64);
|
||||
strcatW (psfi->szTypeName, szDashFile);
|
||||
|
@ -419,11 +469,15 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
|
||||
{
|
||||
UINT uDummy,uFlags;
|
||||
hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, &uDummy, (LPVOID*)&pei);
|
||||
|
||||
hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
|
||||
(LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA,
|
||||
&uDummy, (LPVOID*)&pei);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IExtractIconW_GetIconLocation(pei, (flags & SHGFI_OPENICON)? GIL_OPENICON : 0,szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||
hr = IExtractIconW_GetIconLocation(pei,
|
||||
(flags & SHGFI_OPENICON)? GIL_OPENICON : 0,
|
||||
szLocation, MAX_PATH, &iIndex, &uFlags);
|
||||
psfi->iIcon = iIndex;
|
||||
|
||||
if (uFlags != GIL_NOTFILENAME)
|
||||
|
@ -451,10 +505,12 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
else
|
||||
{
|
||||
static const WCHAR p1W[] = {'%','1',0};
|
||||
|
||||
psfi->iIcon = 0;
|
||||
szExt = (LPWSTR) PathFindExtensionW(sTemp);
|
||||
if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE)
|
||||
&& HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
|
||||
if ( szExt &&
|
||||
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
|
||||
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
|
||||
{
|
||||
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
|
||||
strcpyW(sTemp, szFullPath);
|
||||
|
@ -462,15 +518,22 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (flags & SHGFI_SYSICONINDEX)
|
||||
{
|
||||
psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr);
|
||||
if (psfi->iIcon == -1) psfi->iIcon = 0;
|
||||
if (psfi->iIcon == -1)
|
||||
psfi->iIcon = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
IconNotYetLoaded=FALSE;
|
||||
PrivateExtractIconsW(sTemp,dwNr,(flags & SHGFI_SMALLICON) ?
|
||||
GetSystemMetrics(SM_CXSMICON) : GetSystemMetrics(SM_CXICON),
|
||||
(flags & SHGFI_SMALLICON) ? GetSystemMetrics(SM_CYSMICON) :
|
||||
GetSystemMetrics(SM_CYICON), &psfi->hIcon,0,1,0);
|
||||
if (flags & SHGFI_SMALLICON)
|
||||
PrivateExtractIconsW( sTemp,dwNr,
|
||||
GetSystemMetrics( SM_CXSMICON ),
|
||||
GetSystemMetrics( SM_CYSMICON ),
|
||||
&psfi->hIcon, 0, 1, 0);
|
||||
else
|
||||
PrivateExtractIconsW( sTemp, dwNr,
|
||||
GetSystemMetrics( SM_CXICON),
|
||||
GetSystemMetrics( SM_CYICON),
|
||||
&psfi->hIcon, 0, 1, 0);
|
||||
psfi->iIcon = dwNr;
|
||||
}
|
||||
}
|
||||
|
@ -486,13 +549,21 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
}
|
||||
if (ret)
|
||||
{
|
||||
ret = (DWORD) ((flags & SHGFI_SMALLICON) ? ShellSmallIconList : ShellBigIconList);
|
||||
if (flags & SHGFI_SMALLICON)
|
||||
ret = (DWORD) ShellSmallIconList;
|
||||
else
|
||||
ret = (DWORD) ShellBigIconList;
|
||||
}
|
||||
}
|
||||
|
||||
/* icon handle */
|
||||
if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
|
||||
psfi->hIcon = ImageList_GetIcon((flags & SHGFI_SMALLICON) ? ShellSmallIconList:ShellBigIconList, psfi->iIcon, ILD_NORMAL);
|
||||
{
|
||||
if (flags & SHGFI_SMALLICON)
|
||||
psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
|
||||
else
|
||||
psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL);
|
||||
}
|
||||
|
||||
if (flags & ~SHGFI_KNOWN_FLAGS)
|
||||
FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS);
|
||||
|
@ -503,18 +574,21 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
|||
if (hr != S_OK)
|
||||
ret = FALSE;
|
||||
|
||||
if(pidlLast) SHFree(pidlLast);
|
||||
if (pidlLast)
|
||||
SHFree(pidlLast);
|
||||
|
||||
#ifdef MORE_DEBUG
|
||||
TRACE ("icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n",
|
||||
psfi->hIcon, psfi->iIcon, psfi->dwAttributes, debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
|
||||
psfi->hIcon, psfi->iIcon, psfi->dwAttributes,
|
||||
debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFileInfoA [SHELL32.@]
|
||||
*/
|
||||
|
||||
DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
||||
SHFILEINFOA *psfi, UINT sizeofpsfi,
|
||||
UINT flags )
|
||||
|
@ -524,10 +598,13 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
|||
DWORD ret;
|
||||
SHFILEINFOW temppsfi;
|
||||
|
||||
if (flags & SHGFI_PIDL) {
|
||||
if (flags & SHGFI_PIDL)
|
||||
{
|
||||
/* path contains a pidl */
|
||||
temppath = (LPWSTR) path;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
|
||||
temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
|
||||
|
@ -536,7 +613,10 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
|||
if (psfi && (flags & SHGFI_ATTR_SPECIFIED))
|
||||
temppsfi.dwAttributes=psfi->dwAttributes;
|
||||
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, (psfi == NULL)? NULL : &temppsfi, sizeof(temppsfi), flags);
|
||||
if (psfi == NULL)
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, NULL, sizeof(temppsfi), flags);
|
||||
else
|
||||
ret = SHGetFileInfoW(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
|
||||
|
||||
if (psfi)
|
||||
{
|
||||
|
@ -547,11 +627,20 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
|
|||
if(flags & SHGFI_ATTRIBUTES)
|
||||
psfi->dwAttributes=temppsfi.dwAttributes;
|
||||
if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION))
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1, psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
|
||||
if(flags & SHGFI_TYPENAME)
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1, psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1,
|
||||
psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL);
|
||||
}
|
||||
if(!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
|
||||
if(flags & SHGFI_TYPENAME)
|
||||
{
|
||||
WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1,
|
||||
psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(flags & SHGFI_PIDL))
|
||||
HeapFree(GetProcessHeap(), 0, temppath);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -563,7 +652,7 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon)
|
|||
ICONINFO IconInfo;
|
||||
HICON hDupIcon = 0;
|
||||
|
||||
TRACE("(%p, %p)\n", hInstance, hIcon);
|
||||
TRACE("%p %p\n", hInstance, hIcon);
|
||||
|
||||
if (GetIconInfo(hIcon, &IconInfo))
|
||||
{
|
||||
|
@ -591,6 +680,7 @@ HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex)
|
|||
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
|
||||
ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex);
|
||||
HeapFree(GetProcessHeap(), 0, lpwstrFile);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -605,7 +695,8 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex
|
|||
|
||||
TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex);
|
||||
|
||||
if (nIconIndex == 0xFFFFFFFF) {
|
||||
if (nIconIndex == 0xFFFFFFFF)
|
||||
{
|
||||
ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR);
|
||||
if (ret != 0xFFFFFFFF && ret)
|
||||
return (HICON)ret;
|
||||
|
@ -618,6 +709,7 @@ HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex
|
|||
return (HICON)1;
|
||||
else if (ret > 0 && hIcon)
|
||||
return hIcon;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -638,9 +730,12 @@ typedef struct
|
|||
#define DROP_FIELD_HEIGHT 15
|
||||
|
||||
static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
|
||||
{ HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
|
||||
{
|
||||
HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
|
||||
|
||||
if( hWndCtl )
|
||||
{ GetWindowRect( hWndCtl, lprect );
|
||||
{
|
||||
GetWindowRect( hWndCtl, lprect );
|
||||
MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 );
|
||||
lprect->bottom = (lprect->top += DROP_FIELD_TOP);
|
||||
return TRUE;
|
||||
|
@ -656,8 +751,10 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
|
|||
int width=data->rc.right - data->rc.left;
|
||||
int height=data->rc.bottom - data->rc.top;
|
||||
RECT rec=data->rc;
|
||||
|
||||
switch (msg)
|
||||
{ case ABM_GETSTATE:
|
||||
{
|
||||
case ABM_GETSTATE:
|
||||
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
|
||||
case ABM_GETTASKBARPOS:
|
||||
GetWindowRect(data->hWnd, &rec);
|
||||
|
@ -701,9 +798,8 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
|
|||
*
|
||||
*/
|
||||
DWORD WINAPI SHHelpShortcuts_RunDLL(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
|
||||
{ FIXME("(%lx, %lx, %lx, %lx) empty stub!\n",
|
||||
dwArg1, dwArg2, dwArg3, dwArg4);
|
||||
|
||||
{
|
||||
FIXME("(%lx, %lx, %lx, %lx) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -712,7 +808,6 @@ DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D
|
|||
* Create an instance of specified object class from within
|
||||
* the shell process and release it immediately
|
||||
*/
|
||||
|
||||
HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
@ -772,11 +867,13 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
|||
return 1;
|
||||
|
||||
case WM_PAINT:
|
||||
{ RECT rect;
|
||||
{
|
||||
RECT rect;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC = BeginPaint( hWnd, &ps );
|
||||
|
||||
if( __get_dropline( hWnd, &rect ) ) {
|
||||
if (__get_dropline( hWnd, &rect ))
|
||||
{
|
||||
SelectObject( hDC, GetStockObject( BLACK_PEN ) );
|
||||
MoveToEx( hDC, rect.left, rect.top, NULL );
|
||||
LineTo( hDC, rect.right, rect.bottom );
|
||||
|
@ -868,7 +965,8 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
|
|||
* FreeIconList (SHELL32.@)
|
||||
*/
|
||||
void WINAPI FreeIconList( DWORD dw )
|
||||
{ FIXME("(%lx): stub\n",dw);
|
||||
{
|
||||
FIXME("%lx: stub\n",dw);
|
||||
}
|
||||
|
||||
|
||||
|
@ -927,6 +1025,7 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* global variables of the shell32.dll
|
||||
* all are once per process
|
||||
|
@ -943,7 +1042,6 @@ HIMAGELIST ShellBigIconList = 0;
|
|||
* NOTES
|
||||
* calling oleinitialize here breaks sone apps.
|
||||
*/
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
||||
{
|
||||
TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
|
||||
|
@ -985,8 +1083,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
|||
|
||||
HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||
{
|
||||
FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
|
||||
|
||||
FIXME("%s %s: stub\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
|
||||
return S_OK; /* indicate success */
|
||||
}
|
||||
|
||||
|
@ -995,7 +1092,6 @@ HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
|||
*/
|
||||
HRESULT WINAPI SHELL32_DllCanUnloadNow(void)
|
||||
{
|
||||
FIXME("(void): stub\n");
|
||||
|
||||
FIXME("stub\n");
|
||||
return S_FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue