Commit 0d18aad1 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

- New (some stubs): SHGetFolderLocation, PathAddExtension,

PathIsUNCServer, PathIsUNCServerShare, PathMakePretty, SHCreateShellPalette, SHOpenRegStream, SHOpenRegStream2 - Many string functions implemented - Some stubs for exports by ordinal
parent 6d01aeb2
......@@ -34,6 +34,8 @@ C_SRCS = \
shellole.c \
shellord.c \
shellpath.c \
shellstring.c \
shellreg.c \
shlfileop.c \
shlfolder.c \
shlview.c \
......
......@@ -850,6 +850,25 @@ HRESULT WINAPI SHGetSpecialFolderLocation(
}
/*************************************************************************
* SHGetFolderLocation [SHELL32]
*
* NOTES
* the pidl can be a simple one. since we cant get the path out of the pidl
* we have to take all data from the pidl
*/
HRESULT WINAPI SHGetFolderLocation(
HWND hwnd,
int csidl,
HANDLE hToken,
DWORD dwFlags,
LPITEMIDLIST *ppidl)
{
FIXME("0x%04x 0x%08x 0x%08x 0x%08lx %p\n",
hwnd, csidl, hToken, dwFlags, ppidl);
return SHGetSpecialFolderLocation(hwnd, csidl, ppidl);
}
/*************************************************************************
* SHGetDataFromIDListA [SHELL32.247]
*
* NOTES
......
......@@ -18,8 +18,6 @@ typedef struct
{ ICOM_VFIELD(IStream);
DWORD ref;
HKEY hKey;
LPSTR pszSubKey;
LPSTR pszValue;
LPBYTE pbBuffer;
DWORD dwLength;
DWORD dwPos;
......@@ -28,28 +26,31 @@ typedef struct
static struct ICOM_VTABLE(IStream) rstvt;
/**************************************************************************
* IStream_Constructor()
* IStream_ConstructorA [internal]
*/
IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
{ ISHRegStream* rstr;
IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
{
ISHRegStream* rstr;
DWORD dwType;
rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
ICOM_VTBL(rstr)=&rstvt;
rstr->ref = 1;
if ( ERROR_SUCCESS == RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey)))
{ if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,0,0,&(rstr->dwLength)))
if (!(RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))))
{
if (!(RegQueryValueExA(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength))))
{
/* read the binary data into the buffer */
rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength);
if (rstr->pbBuffer)
{ if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength)))
{ if (dwType == REG_BINARY )
{ rstr->pszSubKey = HEAP_strdupA (GetProcessHeap(),0, pszSubKey);
rstr->pszValue = HEAP_strdupA (GetProcessHeap(),0, pszValue);
TRACE("(%p)->0x%08x,%s,%s,0x%08lx\n", rstr, hKey, pszSubKey, pszValue, grfMode);
if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength)))
{
if (!(RegQueryValueExA(rstr->hKey, pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))))
{
if (dwType == REG_BINARY )
{
shell32_ObjCount++;
TRACE ("%p\n", rstr);
return (IStream*)rstr;
}
}
......@@ -57,7 +58,44 @@ IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD
}
}
RegCloseKey(rstr->hKey);
}
HeapFree (GetProcessHeap(),0,rstr);
return NULL;
}
/**************************************************************************
* IStream_ConstructorW [internal]
*/
IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD grfMode)
{
ISHRegStream* rstr;
DWORD dwType;
rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
ICOM_VTBL(rstr)=&rstvt;
rstr->ref = 1;
if (!(RegOpenKeyExW (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))))
{
if (!(RegQueryValueExW(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength))))
{
/* read the binary data into the buffer */
if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength)))
{
if (!(RegQueryValueExW(rstr->hKey, pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))))
{
if (dwType == REG_BINARY )
{
shell32_ObjCount++;
TRACE ("%p\n", rstr);
return (IStream*)rstr;
}
}
HeapFree (GetProcessHeap(),0,rstr->pbBuffer);
}
}
RegCloseKey(rstr->hKey);
}
HeapFree (GetProcessHeap(),0,rstr);
return NULL;
......@@ -118,12 +156,6 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
if (!--(This->ref))
{ TRACE(" destroying SHReg IStream (%p)\n",This);
if (This->pszSubKey)
HeapFree(GetProcessHeap(),0,This->pszSubKey);
if (This->pszValue)
HeapFree(GetProcessHeap(),0,This->pszValue);
if (This->pbBuffer)
HeapFree(GetProcessHeap(),0,This->pbBuffer);
......@@ -265,13 +297,31 @@ static struct ICOM_VTABLE(IStream) rstvt =
};
/*************************************************************************
* OpenRegStream [SHELL32.85]
*
* NOTES
* exported by ordinal
* SHOpenRegStreamA [SHLWAPI.@][SHELL32.85]
*/
IStream * WINAPI SHOpenRegStreamA(
HKEY hkey,
LPCSTR pszSubkey,
LPCSTR pszValue,
DWORD grfMode)
{
TRACE("(0x%08x,%s,%s,0x%08lx)\n",
hkey, pszSubkey, pszValue, grfMode);
return IStream_ConstructorA(hkey, pszSubkey, pszValue, grfMode);
}
/*************************************************************************
* SHOpenRegStreamW [SHLWAPI.@]
*/
IStream * WINAPI OpenRegStream(HKEY hkey, LPCSTR pszSubkey, LPCSTR pszValue, DWORD grfMode)
IStream * WINAPI SHOpenRegStreamW(
HKEY hkey,
LPCWSTR pszSubkey,
LPCWSTR pszValue,
DWORD grfMode)
{
TRACE("(0x%08x,%s,%s,0x%08lx)\n",hkey, pszSubkey, pszValue, grfMode);
return IStream_Constructor(hkey, pszSubkey, pszValue, grfMode);
TRACE("(0x%08x,%s,%s,0x%08lx)\n",
hkey, debugstr_w(pszSubkey), debugstr_w(pszValue), grfMode);
return IStream_ConstructorW(hkey, pszSubkey, pszValue, grfMode);
}
......@@ -97,7 +97,7 @@ import ole32.dll
82 stdcall DragQueryFileA(long long ptr long) DragQueryFileA
83 stub CIDLData_CreateFromIDArray
84 stub SHIsBadInterfacePtr
85 stdcall OpenRegStream(long long long long) OpenRegStream
85 stdcall OpenRegStream(long str str long) SHOpenRegStreamA
86 stdcall SHRegisterDragDrop(long ptr) SHRegisterDragDrop
87 stdcall SHRevokeDragDrop(long) SHRevokeDragDrop
88 stdcall SHDoDragDrop(long long long long long) SHDoDragDrop
......@@ -160,9 +160,7 @@ import ole32.dll
145 stdcall PathFindOnPath (ptr ptr) PathFindOnPathAW
146 stdcall RLBuildListOfPaths()RLBuildListOfPaths
147 stdcall SHCLSIDFromString(long long) SHCLSIDFromStringAW
148 stdcall ExtractAssociatedIconA(long ptr long) ExtractAssociatedIconA # exported by name
149 stdcall SHFind_InitMenuPopup(long long long long) SHFind_InitMenuPopup
150 stub ExtractAssociatedIconExA # exported by name
151 stdcall SHLoadOLE (long) SHLoadOLE
152 stdcall ILGetSize(ptr) ILGetSize
153 stdcall ILGetNext(ptr) ILGetNext
......@@ -198,15 +196,6 @@ import ole32.dll
183 varargs ShellMessageBoxA(long long long str long) ShellMessageBoxA
184 stdcall ArrangeWindows(long long long long long) ArrangeWindows
185 stub SHHandleDiskFull
186 stub ExtractAssociatedIconExW # exported by name
187 stub ExtractAssociatedIconW # exported by name
188 stdcall ExtractIconA(long str long) ExtractIconA # exported by name
189 stdcall ExtractIconEx(ptr long ptr ptr long) ExtractIconExAW
190 stdcall ExtractIconExA(str long ptr ptr long) ExtractIconExA
191 stdcall ExtractIconExW(wstr long ptr ptr long) ExtractIconExW
192 stub ExtractIconResInfoA # exported by name
193 stub ExtractIconResInfoW # exported by name
194 stdcall ExtractIconW(long wstr long) ExtractIconW # exported by name
195 stdcall SHFree(ptr) SHFree
196 stdcall SHAlloc(long) SHAlloc
197 stub SHGlobalDefect
......@@ -254,9 +243,6 @@ import ole32.dll
239 stdcall SHChangeNotify (long long ptr ptr) SHChangeNotifyAW # exported by name
240 stub SHEmptyRecycleBinA@12 # exported by name
241 stub SHEmptyRecycleBinW@12 # exported by name
@ stdcall SHFileOperation (ptr) SHFileOperationAW
@ stdcall SHFileOperationA (ptr) SHFileOperationA
@ stdcall SHFileOperationW (ptr) SHFileOperationW
243 stdcall shell32_243(long long) shell32_243
244 stdcall SHInitRestricted(ptr ptr) SHInitRestricted # win98+ only, by ordinal
245 stub SHFormatDrive@16 # exported by name
......@@ -266,17 +252,6 @@ import ole32.dll
249 stdcall PathParseIconLocation (ptr) PathParseIconLocationAW
250 stdcall PathRemoveExtension (ptr) PathRemoveExtensionAW
251 stdcall PathRemoveArgs (ptr) PathRemoveArgsAW
@ stdcall SHGetDesktopFolder(ptr) SHGetDesktopFolder
@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoAW
@ stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfoA
@ stdcall SHGetFileInfoW(ptr long ptr long long) SHGetFileInfoW
@ stdcall SHGetInstanceExplorer (long) SHGetInstanceExplorer
@ stdcall SHGetMalloc(ptr) SHGetMalloc
@ stub SHGetNewLinkInfo@20
@ stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListAW
@ stdcall SHGetPathFromIDListA (long long) SHGetPathFromIDListA
@ stdcall SHGetPathFromIDListW (long long) SHGetPathFromIDListW
@ stdcall SHGetSpecialFolderLocation(long long ptr) SHGetSpecialFolderLocation # exported by name
264 stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLL # exported by name
265 stub SHHelpShortcuts_RunDLLA@16 # exported by name
266 stub SHHelpShortcuts_RunDLLW@16 # exported by name
......@@ -284,7 +259,6 @@ import ole32.dll
268 stub SHQueryRecycleBinA@8 # exported by name
269 stub SHQueryRecycleBinW@8 # exported by name
270 stub SHUpdateRecycleBinIcon@0 # exported by name
271 stub SheChangeDirA
272 stub SheChangeDirExA
273 stub SheChangeDirExW
......@@ -315,14 +289,14 @@ import ole32.dll
298 stdcall Shell_NotifyIconW(long ptr) Shell_NotifyIconW
299 stub Shl1632_ThunkData32
300 stub Shl3216_ThunkData32
301 stub StrChrA
301 stdcall StrChrA (str long) StrChrA
302 stub StrChrIA
303 stub StrChrIW
304 stdcall StrChrW (wstr long) StrChrW
305 stub StrCmpNA
306 stub StrCmpNIA
305 stdcall StrCmpNA(str str long) StrCmpNA
306 stdcall StrCmpNIA (str str long) StrCmpNIA
307 stdcall StrCmpNIW (wstr wstr long) StrCmpNIW
308 stub StrCmpNW
308 stdcall StrCmpNW (wstr wstr long) StrCmpNW
309 stdcall StrCpyNA (ptr str long) lstrcpynA
310 stdcall StrCpyNW (ptr wstr long)lstrcpynW
311 stub StrNCmpA
......@@ -339,10 +313,10 @@ import ole32.dll
322 stub StrRStrIA
323 stub StrRStrIW
324 stub StrRStrW
325 stub StrStrA
326 stub StrStrIA
327 stub StrStrIW
328 stub StrStrW
325 stdcall StrStrA(str str)StrStrA
326 stdcall StrStrIA(str str)StrStrIA
327 stdcall StrStrIW(wstr wstr)StrStrIW
328 stdcall StrStrW(wstr wstr)StrStrW
329 stub WOWShellExecute # proper ordinal unknown
505 stdcall SHRegCloseKey (long) SHRegCloseKey
......@@ -385,6 +359,10 @@ import ole32.dll
680 stdcall IsUserAdmin () IsUserAdmin
# >= NT5
714 stdcall SHELL32_714(ptr)SHELL32_714
@ stdcall SHGetFolderLocation(long long long long ptr)SHGetFolderLocation
1217 stub FOOBAR1217 # no joke! This is the real name!!
# later additions ... FIXME: incorrect ordinals
......@@ -396,6 +374,32 @@ import ole32.dll
1222 stdcall DoEnvironmentSubstA (str str) DoEnvironmentSubstA # win98:293
1223 stdcall DoEnvironmentSubstW (wstr wstr) DoEnvironmentSubstW # win98:204
# by-name routines relocated in win98
# by-name routines
@ stdcall DllInstall (long wstr) SHELL32_DllInstall
@ stdcall DllInstall (long wstr) SHELL32_DllInstall
@ stdcall ExtractAssociatedIconA(long ptr long) ExtractAssociatedIconA # exported by name
@ stub ExtractAssociatedIconExA # exported by name
@ stub ExtractAssociatedIconExW # exported by name
@ stub ExtractAssociatedIconW # exported by name
@ stdcall ExtractIconA(long str long) ExtractIconA # exported by name
@ stdcall ExtractIconEx(ptr long ptr ptr long) ExtractIconExAW
@ stdcall ExtractIconExA(str long ptr ptr long) ExtractIconExA
@ stdcall ExtractIconExW(wstr long ptr ptr long) ExtractIconExW
@ stdcall ExtractIconW(long wstr long) ExtractIconW # exported by name
@ stub ExtractIconResInfoA # exported by name
@ stub ExtractIconResInfoW # exported by name
@ stdcall SHFileOperation (ptr) SHFileOperationAW
@ stdcall SHFileOperationA (ptr) SHFileOperationA
@ stdcall SHFileOperationW (ptr) SHFileOperationW
@ stdcall SHGetDesktopFolder(ptr) SHGetDesktopFolder
@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoAW
@ stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfoA
@ stdcall SHGetFileInfoW(ptr long ptr long long) SHGetFileInfoW
@ stdcall SHGetInstanceExplorer (long) SHGetInstanceExplorer
@ stdcall SHGetMalloc(ptr) SHGetMalloc
@ stub SHGetNewLinkInfo@20
@ stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListAW
@ stdcall SHGetPathFromIDListA (long long) SHGetPathFromIDListA
@ stdcall SHGetPathFromIDListW (long long) SHGetPathFromIDListW
@ stdcall SHGetSpecialFolderLocation(long long ptr) SHGetSpecialFolderLocation # exported by name
......@@ -98,6 +98,7 @@ void WINAPI Control_RunDLL( HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
/*************************************************************************
* SHGetFileInfoA [SHELL32.@]
*
*/
DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
......@@ -118,6 +119,11 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
return FALSE;
/* windows initializes this values regardless of the flags */
psfi->szDisplayName[0] = '\0';
psfi->szTypeName[0] = '\0';
psfi->iIcon = 0;
/* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified
the pidl functions fail on not existing file names */
if (flags & SHGFI_PIDL)
......@@ -298,6 +304,9 @@ DWORD WINAPI SHGetFileInfoAW(
/*************************************************************************
* ExtractIconA [SHELL32.133]
*
* fixme
* is the filename is not a file return 1
*/
HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
UINT nIconIndex )
......@@ -316,6 +325,9 @@ HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
/*************************************************************************
* ExtractIconW [SHELL32.180]
*
* fixme
* is the filename is not a file return 1
*/
HICON WINAPI ExtractIconW( HINSTANCE hInstance, LPCWSTR lpszExeFileName,
UINT nIconIndex )
......@@ -703,7 +715,7 @@ void WINAPI FreeIconList( DWORD dw )
}
/***********************************************************************
* DllGetVersion [COMCTL32.25]
* DllGetVersion [SHELL32]
*
* Retrieves version information of the 'SHELL32.DLL'
*
......@@ -721,7 +733,8 @@ void WINAPI FreeIconList( DWORD dw )
HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
{
if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
{ WARN("wrong DLLVERSIONINFO size from app");
{
WARN("wrong DLLVERSIONINFO size from app");
return E_INVALIDARG;
}
......@@ -736,6 +749,42 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
return S_OK;
}
/***********************************************************************
* DllGetVersion [SHLWAPI]
*
* Retrieves version information of the 'SHLWAPI.DLL'
*
* PARAMS
* pdvi [O] pointer to version information structure.
*
* RETURNS
* Success: S_OK
* Failure: E_INVALIDARG
*
* NOTES
* Returns version of a SHLWAPI.dll from IE5.01.
*/
HRESULT WINAPI SHLWAPI_DllGetVersion (DLLVERSIONINFO *pdvi)
{
if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
{
WARN("wrong DLLVERSIONINFO size from app");
return E_INVALIDARG;
}
pdvi->dwMajorVersion = 5;
pdvi->dwMinorVersion = 0;
pdvi->dwBuildNumber = 2314;
pdvi->dwPlatformID = 1000;
TRACE("%lu.%lu.%lu.%lu\n",
pdvi->dwMajorVersion, pdvi->dwMinorVersion,
pdvi->dwBuildNumber, pdvi->dwPlatformID);
return S_OK;
}
/*************************************************************************
* global variables of the shell32.dll
* all are once per process
......
......@@ -75,8 +75,6 @@ LPVOID WINAPI PathAppendAW(
*
* FIXME
* the resulting path is also canonicalized
* If lpszSrcPath2 starts with a backslash it is appended
* to the root of lpszSrcPath1.
*/
LPSTR WINAPI PathCombineA(
LPSTR szDest,
......@@ -94,10 +92,17 @@ LPSTR WINAPI PathCombineA(
}
/* if lpszFile is a complete path don't care about lpszDir */
if (PathIsRootA(lpszFile))
if (PathGetDriveNumberA(lpszFile) != -1)
{
strcpy(szDest,lpszFile);
}
else if (lpszFile[0] == '\\' )
{
strcpy(sTemp,lpszDir);
PathStripToRootA(sTemp);
strcat(sTemp,lpszFile);
strcpy(szDest,sTemp);
}
else
{
strcpy(sTemp,lpszDir);
......@@ -128,10 +133,17 @@ LPWSTR WINAPI PathCombineW(
}
/* if lpszFile is a complete path don't care about lpszDir */
if (PathIsRootW(lpszFile))
if (PathGetDriveNumberW(lpszFile) != -1)
{
CRTDLL_wcscpy(szDest,lpszFile);
}
else if (lpszFile[0] == (WCHAR)'\\' )
{
CRTDLL_wcscpy(sTemp,lpszDir);
PathStripToRootW(sTemp);
CRTDLL_wcscat(sTemp,lpszFile);
CRTDLL_wcscpy(szDest,sTemp);
}
else
{
CRTDLL_wcscpy(sTemp,lpszDir);
......@@ -769,7 +781,7 @@ LPWSTR WINAPI PathRemoveBackslashW( LPWSTR lpszPath )
{
LPWSTR p = lpszPath;
while (*lpszPath); p = lpszPath++;
while (*lpszPath) p = lpszPath++;
if ( *p == (WCHAR)'\\') *p = (WCHAR)'\0';
return p;
}
......@@ -2188,3 +2200,134 @@ LPWSTR WINAPI PathFindNextComponentW(LPCWSTR pszPath)
}
return NULL;
}
/*************************************************************************
* PathAddExtensionA
*/
static void _PathAddDotA(LPSTR lpszPath)
{
int len = strlen(lpszPath);
if (len && lpszPath[len-1]!='.')
{
lpszPath[len] = '.';
lpszPath[len+1]= '\0';
}
}
BOOL WINAPI PathAddExtensionA(
LPSTR pszPath,
LPCSTR pszExtension)
{
if (*pszPath)
{
LPSTR pszExt = PathFindFileNameA(pszPath); /* last path component */
pszExt = PathFindExtensionA(pszExt);
if (*pszExt != '\0') return FALSE; /* already with extension */
_PathAddDotA(pszPath);
}
if (!pszExtension || *pszExtension=='\0')
strcat(pszPath, "exe");
else
strcat(pszPath, pszExtension);
return TRUE;
}
/*************************************************************************
* PathAddExtensionW
*/
static void _PathAddDotW(LPWSTR lpszPath)
{
int len = lstrlenW(lpszPath);
if (len && lpszPath[len-1]!='.')
{
lpszPath[len] = '.';
lpszPath[len+1]= '\0';
}
}
/*************************************************************************
* PathAddExtensionW
*/
BOOL WINAPI PathAddExtensionW(
LPWSTR pszPath,
LPCWSTR pszExtension)
{
static const WCHAR ext[] = { 'e','x','e',0 };
if (*pszPath)
{
LPWSTR pszExt = PathFindFileNameW(pszPath); /* last path component */
pszExt = PathFindExtensionW(pszExt);
if (*pszExt != '\0') return FALSE; /* already with extension */
_PathAddDotW(pszPath);
}
if (!pszExtension || *pszExtension=='\0')
lstrcatW(pszPath, ext);
else
lstrcatW(pszPath, pszExtension);
return TRUE;
}
/*************************************************************************
* PathIsUNCServerA
*/
BOOL WINAPI PathIsUNCServerA(
LPCSTR pszPath)
{
FIXME("%s\n", pszPath);
return FALSE;
}
/*************************************************************************
* PathIsUNCServerW
*/
BOOL WINAPI PathIsUNCServerW(
LPCWSTR pszPath)
{
FIXME("%s\n", debugstr_w(pszPath));
return FALSE;
}
/*************************************************************************
* PathIsUNCServerShareA
*/
BOOL WINAPI PathIsUNCServerShareA(
LPCSTR pszPath)
{
FIXME("%s\n", pszPath);
return FALSE;
}
/*************************************************************************
* PathIsUNCServerShareW
*/
BOOL WINAPI PathIsUNCServerShareW(
LPCWSTR pszPath)
{
FIXME("%s\n", debugstr_w(pszPath));
return FALSE;
}
/*************************************************************************
* PathMakePrettyA
*/
BOOL WINAPI PathMakePrettyA(
LPSTR lpPath)
{
FIXME("%s\n", lpPath);
return TRUE;
}
/*************************************************************************
* PathMakePrettyW
*/
BOOL WINAPI PathMakePrettyW(
LPWSTR lpPath)
{
FIXME("%s\n", debugstr_w(lpPath));
return TRUE;
}
/*
Shell Registry Access
*/
#include <string.h>
#include <stdio.h>
#include "winerror.h"
#include "winreg.h"
#include "debugtools.h"
#include "winnls.h"
#include "winversion.h"
#include "heap.h"
#include "crtdll.h"
#include "shellapi.h"
#include "shlobj.h"
#include "shell32_main.h"
#include "wine/undocshell.h"
DEFAULT_DEBUG_CHANNEL(shell);
/*************************************************************************
* SHRegOpenKeyA [SHELL32.506]
*
*/
HRESULT WINAPI SHRegOpenKeyA(
HKEY hKey,
LPSTR lpSubKey,
LPHKEY phkResult)
{
TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
return RegOpenKeyA(hKey, lpSubKey, phkResult);
}
/*************************************************************************
* SHRegOpenKeyW [NT4.0:SHELL32.507]
*
*/
HRESULT WINAPI SHRegOpenKeyW (
HKEY hkey,
LPCWSTR lpszSubKey,
LPHKEY retkey)
{
WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
return RegOpenKeyW( hkey, lpszSubKey, retkey );
}
/*************************************************************************
* SHRegQueryValueExA SHQueryValueExA [SHELL32.509][SHLWAPI.@]
*
*/
HRESULT WINAPI SHRegQueryValueExA(
HKEY hkey,
LPSTR lpValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData)
{
TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
}
/*************************************************************************
* SHRegQueryValueW [NT4.0:SHELL32.510]
*
*/
HRESULT WINAPI SHRegQueryValueW(
HKEY hkey,
LPWSTR lpszSubKey,
LPWSTR lpszData,
LPDWORD lpcbData )
{
WARN("0x%04x %s %p %p semi-stub\n",
hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
}
/*************************************************************************
* SHRegQueryValueExW, SHQueryValueExW [NT4.0:SHELL32.511][SHLWAPI.@]
*
* FIXME
* if the datatype REG_EXPAND_SZ then expand the string and change
* *pdwType to REG_SZ.
*/
HRESULT WINAPI SHRegQueryValueExW (
HKEY hkey,
LPWSTR pszValue,
LPDWORD pdwReserved,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData)
{
DWORD ret;
WARN("0x%04x %s %p %p %p %p semi-stub\n",
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
return ret;
}
/* SHGetValue: Gets a value from the registry */
/*************************************************************************
* SHGetValueA
*
* Gets a value from the registry
*/
DWORD WINAPI SHGetValueA(
HKEY hkey,
LPCSTR pSubKey,
LPCSTR pValue,
LPDWORD pwType,
LPVOID pvData,
LPDWORD pbData)
{
HKEY hSubKey;
DWORD res;
TRACE("(%s %s)\n", pSubKey, pValue);
if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
RegCloseKey( hSubKey );
return res;
}
/*************************************************************************
* SHGetValueW
*
* Gets a value from the registry
*/
DWORD WINAPI SHGetValueW(
HKEY hkey,
LPCWSTR pSubKey,
LPCWSTR pValue,
LPDWORD pwType,
LPVOID pvData,
LPDWORD pbData)
{
HKEY hSubKey;
DWORD res;
TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
RegCloseKey( hSubKey );
return res;
}
/* gets a user-specific registry value. */
/*************************************************************************
* SHRegGetUSValueA
*
* Gets a user-specific registry value
*/
LONG WINAPI SHRegGetUSValueA(
LPCSTR pSubKey,
LPCSTR pValue,
LPDWORD pwType,
LPVOID pvData,
LPDWORD pbData,
BOOL fIgnoreHKCU,
LPVOID pDefaultData,
DWORD wDefaultDataSize)
{
FIXME("(%p),stub!\n", pSubKey);
return ERROR_SUCCESS; /* return success */
}
/*************************************************************************
* SHRegGetUSValueW
*
* Gets a user-specific registry value
*/
LONG WINAPI SHRegGetUSValueW(
LPCWSTR pSubKey,
LPCWSTR pValue,
LPDWORD pwType,
LPVOID pvData,
LPDWORD pbData,
BOOL flagIgnoreHKCU,
LPVOID pDefaultData,
DWORD wDefaultDataSize)
{
FIXME("(%p),stub!\n", pSubKey);
return ERROR_SUCCESS; /* return success */
}
/*************************************************************************
* SHRegGetBoolUSValueA
*/
BOOL WINAPI SHRegGetBoolUSValueA(
LPCSTR pszSubKey,
LPCSTR pszValue,
BOOL fIgnoreHKCU,
BOOL fDefault)
{
FIXME("%s %s\n", pszSubKey,pszValue);
return fDefault;
}
/*************************************************************************
* SHRegGetBoolUSValueW
*/
BOOL WINAPI SHRegGetBoolUSValueW(
LPCWSTR pszSubKey,
LPCWSTR pszValue,
BOOL fIgnoreHKCU,
BOOL fDefault)
{
FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
return fDefault;
}
/*************************************************************************
* SHRegQueryUSValueA [SHLWAPI]
*/
LONG WINAPI SHRegQueryUSValueA(
HKEY/*HUSKEY*/ hUSKey,
LPCSTR pszValue,
LPDWORD pdwType,
void *pvData,
LPDWORD pcbData,
BOOL fIgnoreHKCU,
void *pvDefaultData,
DWORD dwDefaultDataSize)
{
FIXME("%s stub\n",pszValue);
return 1;
}
/*************************************************************************
* SHRegGetPathA
*/
DWORD WINAPI SHRegGetPathA(
HKEY hKey,
LPCSTR pcszSubKey,
LPCSTR pcszValue,
LPSTR pszPath,
DWORD dwFlags)
{
FIXME("%s %s\n", pcszSubKey, pcszValue);
return 0;
}
/*************************************************************************
* SHRegGetPathW
*/
DWORD WINAPI SHRegGetPathW(
HKEY hKey,
LPCWSTR pcszSubKey,
LPCWSTR pcszValue,
LPWSTR pszPath,
DWORD dwFlags)
{
FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
return 0;
}
/*************************************************************************
* SHRegDeleteKeyA and SHDeleteKeyA
*/
HRESULT WINAPI SHRegDeleteKeyA(
HKEY hkey,
LPCSTR pszSubKey)
{
FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
return 0;
}
/*************************************************************************
* SHRegDeleteKeyW and SHDeleteKeyA
*/
HRESULT WINAPI SHRegDeleteKeyW(
HKEY hkey,
LPCWSTR pszSubKey)
{
FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
return 0;
}
/*************************************************************************
* SHSetValueA [SHLWAPI]
*/
DWORD WINAPI SHSetValueA(
HKEY hkey,
LPCSTR pszSubKey,
LPCSTR pszValue,
DWORD dwType,
LPCVOID pvData,
DWORD cbData)
{
FIXME("(%s %s)stub\n",pszSubKey, pszValue);
return 1;
}
/*************************************************************************
* SHRegCloseKey [NT4.0:SHELL32.505]
*
*/
HRESULT WINAPI SHRegCloseKey (HKEY hkey)
{
TRACE("0x%04x\n",hkey);
return RegCloseKey( hkey );
}
......@@ -1819,12 +1819,12 @@ static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder2 * iface,
if(IsEqualIID(riid, &IID_IDropTarget))
{
FIXME("IDropTarget not implemented\n");
WARN("IDropTarget not implemented\n");
hr = E_NOTIMPL;
}
else if(IsEqualIID(riid, &IID_IContextMenu))
{
FIXME("IContextMenu not implemented\n");
WARN("IContextMenu not implemented\n");
hr = E_NOTIMPL;
}
else if(IsEqualIID(riid, &IID_IShellView))
......@@ -2242,12 +2242,12 @@ static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder2 * iface,
if(IsEqualIID(riid, &IID_IDropTarget))
{
FIXME("IDropTarget not implemented\n");
WARN("IDropTarget not implemented\n");
hr = E_NOTIMPL;
}
else if(IsEqualIID(riid, &IID_IContextMenu))
{
FIXME("IContextMenu not implemented\n");
WARN("IContextMenu not implemented\n");
hr = E_NOTIMPL;
}
else if(IsEqualIID(riid, &IID_IShellView))
......
......@@ -106,7 +106,7 @@ static LPFMINFO FM_SetMenuParameter(
*/
static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl)
{ IShellFolder *lpsf, *lpsf2;
ULONG ulItemAttr;
ULONG ulItemAttr = SFGAO_FOLDER;
UINT uID, uFlags, uEnumFlags;
LPFNFMCALLBACK lpfnCallback;
LPITEMIDLIST pidl;
......
......@@ -64,3 +64,39 @@ BUGS:
- many examples from MSDN
Feb-21-2000 <juergen.schmied@debitel.net>
4. native shell32
-----------------
4.1 win95/98
IShellFolder_GetAttributesOf sometimes returns more bits set
than the mask asked for
4.2 NT4
4.3 NT5
----------
SHGetSpecialFolderLocation needs the <winntdir>/Recent directory.
If the directory is missing it returns a x80070002.
needed Registry keys:
----------------------------
[MACHINE\\Software\\Classes\\CLSID\\{00021400-0000-0000-c000-000000000046}] 957887196
@="Desktop"
[MACHINE\\Software\\Classes\\CLSID\\{00021400-0000-0000-c000-000000000046}\\InProcServer32] 957887196
@="shell32.dll"
"ThreadingModel"="Apartment"
[MACHINE\\Software\\Classes\\CLSID\\{000214e6-0000-0000-c000-000000000046}] 957887196
@="Shellfolder"
[MACHINE\\Software\\Classes\\CLSID\\{000214e6-0000-0000-c000-000000000046}\\InProcServer32] 957887196
@="shell32.dll"
"ThreadingModel"="Apartment"
----------------------------
......@@ -29,6 +29,14 @@ BOOL WINAPI PathIsURLA(LPCSTR pszPath);
BOOL WINAPI PathIsURLW(LPCWSTR pszPath);
#define PathIsURL WINELIB_NAME_AW(PathIsURL)
BOOL WINAPI PathAddExtensionA(LPSTR pszPath, LPCSTR pszExt);
BOOL WINAPI PathAddExtensionW(LPWSTR pszPath, LPCWSTR pszExt);
#define PathAddExtension WINELIB_NAME_AW(PathAddExtension)
BOOL WINAPI PathStripToRootA(LPSTR pszPath);
BOOL WINAPI PathStripToRootW(LPWSTR pszPath);
#define PathStripToRoot WINELIB_NAME_AW(PathStripToRoot)
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
......
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