Fixed wrong parameter count for SHChangeNotifyDeregister, SHFreeUnusedLibraries.

New functions ParseField, Get/SetInstanceExplorer(), PathIsUNC, PathIsRelative.
Stubs SHWaitForFileToOpen, PathFindOnPath.
This commit is contained in:
Juergen Schmied 1998-12-01 08:55:13 +00:00 committed by Alexandre Julliard
parent 28d3542071
commit 07e0d947da
7 changed files with 167 additions and 34 deletions

View File

@ -927,13 +927,16 @@ HIMAGELIST (CALLBACK * pImageList_Create) (INT32,INT32,UINT32,INT32,INT32);
HICON32 (CALLBACK * pImageList_GetIcon) (HIMAGELIST, INT32, UINT32);
INT32 (CALLBACK* pImageList_GetImageCount)(HIMAGELIST);
LPVOID (CALLBACK* pCOMCTL32_Alloc) (INT32);
BOOL32 (CALLBACK* pCOMCTL32_Free) (LPVOID);
HDPA (CALLBACK* pDPA_Create) (INT32);
INT32 (CALLBACK* pDPA_InsertPtr) (const HDPA, INT32, LPVOID);
BOOL32 (CALLBACK* pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
LPVOID (CALLBACK* pDPA_GetPtr) (const HDPA, INT32);
BOOL32 (CALLBACK* pDPA_Destroy) (const HDPA);
INT32 (CALLBACK *pDPA_Search) (const HDPA, LPVOID, INT32, PFNDPACOMPARE, LPARAM, UINT32);
static BOOL32 bShell32IsInitialized=0;
/*************************************************************************
* SHELL32 LibMain
*
@ -950,7 +953,7 @@ BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvRe
shell32_hInstance = hinstDLL;
if (fdwReason==DLL_PROCESS_ATTACH)
if (fdwReason==DLL_PROCESS_ATTACH && !bShell32IsInitialized)
{ hComctl32 = LoadLibrary32A("COMCTL32.DLL");
if (hComctl32)
{ pDLLInitComctl=GetProcAddress32(hComctl32,"InitCommonControlsEx");
@ -964,6 +967,8 @@ BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvRe
pImageList_GetImageCount=GetProcAddress32(hComctl32,"ImageList_GetImageCount");
/* imports by ordinal, pray that it works*/
pCOMCTL32_Alloc=GetProcAddress32(hComctl32, (LPCSTR)71L);
pCOMCTL32_Free=GetProcAddress32(hComctl32, (LPCSTR)73L);
pDPA_Create=GetProcAddress32(hComctl32, (LPCSTR)328L);
pDPA_Destroy=GetProcAddress32(hComctl32, (LPCSTR)329L);
pDPA_GetPtr=GetProcAddress32(hComctl32, (LPCSTR)332L);
@ -979,6 +984,7 @@ BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvRe
exit (1);
}
SIC_Initialize();
bShell32IsInitialized = TRUE;
}
return TRUE;
}

View File

@ -22,6 +22,10 @@ extern INT32 (CALLBACK* pImageList_ReplaceIcon) (HIMAGELIST, INT32, HICON32);
extern HIMAGELIST (CALLBACK * pImageList_Create) (INT32,INT32,UINT32,INT32,INT32);
extern HICON32 (CALLBACK * pImageList_GetIcon) (HIMAGELIST, INT32, UINT32);
extern INT32 (CALLBACK* pImageList_GetImageCount)(HIMAGELIST);
extern LPVOID (CALLBACK* pCOMCTL32_Alloc) (INT32);
extern BOOL32 (CALLBACK* pCOMCTL32_Free) (LPVOID);
extern HDPA (CALLBACK* pDPA_Create) (INT32);
extern INT32 (CALLBACK* pDPA_InsertPtr) (const HDPA, INT32, LPVOID);
extern BOOL32 (CALLBACK* pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
@ -36,6 +40,11 @@ extern HICON32 WINAPI SIC_GetIcon (LPSTR sSourceFile, DWORD dwSourceIndex, BOOL3
/* Classes Root */
extern BOOL32 WINAPI HCR_MapTypeToValue ( LPSTR szExtension, LPSTR szFileType, DWORD len);
HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID);
LPVOID WINAPI SHLockShared(HANDLE32 hmem, DWORD procID);
BOOL32 WINAPI SHUnlockShared(HANDLE32 pmem);
HANDLE32 WINAPI SHFreeShared(HANDLE32 hmem, DWORD procID);
/* FIXME should be moved to a header file. IsEqualGUID
is declared but not exported in compobj.c !!!*/
#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))

View File

@ -56,8 +56,8 @@ SHChangeNotifyRegister(
* SHChangeNotifyDeregister [SHELL32.4]
*/
DWORD WINAPI
SHChangeNotifyDeregister(LONG x1,LONG x2)
{ FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",x1,x2);
SHChangeNotifyDeregister(LONG x1)
{ FIXME(shell,"(0x%08lx):stub.\n",x1);
return 0;
}
@ -65,13 +65,27 @@ SHChangeNotifyDeregister(LONG x1,LONG x2)
* ParseField [SHELL32.58]
*
*/
DWORD WINAPI ParseField(LPCSTR src,DWORD x2,LPSTR target,DWORD pathlen) {
FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",
src,x2,target,pathlen
);
if (!src)
return 0;
return 0;
DWORD WINAPI ParseField(LPCSTR src,DWORD field,LPSTR dst,DWORD len)
{ FIXME(shell,"(%s,0x%08lx,%p,%ld):stub.\n",src,field,dst,len);
if (!src || !src[0] || !dst || !len)
return 0;
if (field >1)
{ field--;
while (field)
{ if (*src==0x0) return FALSE;
if (*src==',') field--;
src++;
}
}
while (*src!=0x00 && *src!=',' && len>0)
{ *dst=*src; dst++, src++; len--;
}
*dst=0x0;
return TRUE;
}
/*************************************************************************
@ -636,23 +650,34 @@ BOOL32 WINAPI ShellExecuteEx32W (LPSHELLEXECUTEINFO32W sei)
return 0;
}
static LPUNKNOWN SHELL32_IExplorerInterface=0;
/*************************************************************************
* SHSetInstanceExplorer [SHELL32.176]
*
* NOTES
* Sets the interface
*/
HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
{ TRACE (shell,"%p\n", lpUnknown);
SHELL32_IExplorerInterface = lpUnknown;
return (HRESULT) lpUnknown;
}
/*************************************************************************
* SHGetInstanceExplorer [SHELL32.256]
*
* NOTES
* exported by name
* gets the interface pointer of the explorer and a reference
*/
HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
{ TRACE(shell,"%p\n", lpUnknown);
*lpUnknown = SHELL32_IExplorerInterface;
if (!SHELL32_IExplorerInterface)
return E_FAIL;
SHELL32_IExplorerInterface->lpvtbl->fnAddRef(SHELL32_IExplorerInterface);
return NOERROR;
}
/*************************************************************************
* SHFreeUnusedLibraries [SHELL32.123]
@ -660,9 +685,9 @@ HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
* NOTES
* exported by name
*/
HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
{ FIXME(shell,"0x%08lx stub\n",u);
return 0;
HRESULT WINAPI SHFreeUnusedLibraries (void)
{ FIXME(shell,"stub\n");
return TRUE;
}
/*************************************************************************
* DAD_ShowDragImage [SHELL32.137]
@ -897,7 +922,7 @@ HGLOBAL32 WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
* the receiver of (WM_USER+2) trys to lock the HANDLE (?)
* the returnvalue seems to be a memoryadress
*/
void * WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
LPVOID WINAPI SHLockShared(HANDLE32 hmem, DWORD procID)
{ TRACE(shell,"handle=0x%04x procID=0x%04lx\n",hmem,procID);
return GlobalLock32(hmem);
}
@ -1171,3 +1196,11 @@ LPWSTR WINAPI StrFormatByteSize32W ( DWORD dw, LPWSTR pszBuf, UINT32 cchBuf )
lstrcpynAtoW (pszBuf, buf, cchBuf);
return pszBuf;
}
/*************************************************************************
* SHWaitForFileToOpen [SHELL32.97]
*
*/
HRESULT WINAPI SHWaitForFileToOpen(DWORD u, DWORD v, DWORD w)
{ FIXME(shell,"0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
return 0;
}

View File

@ -344,12 +344,48 @@ LPVOID WINAPI PathCombine32AW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile)
* NOTES
* PathIsUNC(char*path);
*/
BOOL32 WINAPI PathIsUNC(LPCSTR path) {
TRACE(shell,"%s\n",path);
BOOL32 WINAPI PathIsUNC32A(LPCSTR path)
{ TRACE(shell,"%s\n",path);
if ((path[0]=='\\') && (path[1]=='\\'))
return TRUE;
return TRUE;
return FALSE;
}
BOOL32 WINAPI PathIsUNC32W(LPCWSTR path)
{ TRACE(shell,"%s\n",debugstr_w(path));
if ((path[0]=='\\') && (path[1]=='\\'))
return TRUE;
return FALSE;
}
BOOL32 WINAPI PathIsUNC32AW (LPCVOID path)
{ if (VERSION_OsIsUnicode())
return PathIsUNC32W( path );
return PathIsUNC32A( path );
}
/*************************************************************************
* PathIsRelativ [SHELL32.40]
*
*/
BOOL32 WINAPI PathIsRelative32A (LPCSTR path)
{ TRACE(shell,"path=%s\n",path);
if (path && (path[0]!='\\' && path[1]==':'))
return TRUE;
return FALSE;
}
BOOL32 WINAPI PathIsRelative32W (LPCWSTR path)
{ TRACE(shell,"path=%s\n",debugstr_w(path));
if (path && (path[0]!='\\' && path[1]==':'))
return TRUE;
return FALSE;
}
BOOL32 WINAPI PathIsRelative32AW (LPCVOID path)
{ if (VERSION_OsIsUnicode())
return PathIsRelative32W( path );
return PathIsRelative32A( path );
}
/*************************************************************************
* PathIsExe [SHELL32.43]
*
@ -584,6 +620,23 @@ BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
return FALSE;
return fnlen>12;
}
/*************************************************************************
* PathFindOnPath [SHELL32.145]
*/
BOOL32 WINAPI PathFindOnPath32A(LPSTR sFile, LPCSTR sOtherDirs)
{ FIXME(shell,"%s %s\n",sFile, sOtherDirs);
return FALSE;
}
BOOL32 WINAPI PathFindOnPath32W(LPWSTR sFile, LPCWSTR sOtherDirs)
{ FIXME(shell,"%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs));
return FALSE;
}
BOOL32 WINAPI PathFindOnPath32AW(LPVOID sFile, LPCVOID sOtherDirs)
{ if (VERSION_OsIsUnicode())
return PathFindOnPath32W(sFile, sOtherDirs);
return PathFindOnPath32A(sFile, sOtherDirs);
}
/*************************************************************************
* PathGetExtension [SHELL32.158]
*

View File

@ -878,8 +878,25 @@ void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
}
else /* we are acting with a full featured IShellBrowser */
{ TRACE(shell,"-- explorer: BrowseObject pidl =%p\n", this->aSelectedItems[0]);
wFlags = SBSP_SAMEBROWSER | SBSP_DEFMODE | SBSP_RELATIVE;
IShellBrowser_BrowseObject(this->pShellBrowser, this->aSelectedItems[0], wFlags);
/*wFlags = SBSP_SAMEBROWSER | SBSP_DEFMODE | SBSP_RELATIVE;
IShellBrowser_BrowseObject(this->pShellBrowser, this->aSelectedItems[0], wFlags);*/
{ int i = ILGetSize( this->aSelectedItems[0] );
char commandline[255];
STARTUPINFO32A startupinfo;
PROCESS_INFORMATION processinformation;
HGLOBAL32 hmem;
ZeroMemory(&startupinfo,sizeof(STARTUPINFO32A));
startupinfo.cb = sizeof(STARTUPINFO32A);
hmem = SHAllocShared ( this->aSelectedItems[0], i, 0);
sprintf (commandline, " /N,/IDList,:%li", (DWORD)SHLockShared(hmem,0));
CreateProcess32A("explorer.exe", commandline, NULL, NULL, FALSE, 0,
NULL, NULL, &startupinfo, &processinformation);
SHUnlockShared(hmem);
}
}
}
else

View File

@ -236,7 +236,7 @@ typedef struct
} IDSTRUCT;
DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2);
DWORD WINAPI SHChangeNotifyDeregister(LONG x1);
/****************************************************************************
* SHAddToRecentDocs API
@ -293,6 +293,21 @@ LPWSTR WINAPI PathRemoveBlanks32W(LPWSTR str);
#define PathRemoveBlanks WINELIB_NAME_AW(PathRemoveBlanks)
LPVOID WINAPI PathRemoveBlanks32AW(LPVOID str);
BOOL32 WINAPI PathIsRelative32A(LPCSTR str);
BOOL32 WINAPI PathIsRelative32W(LPCWSTR str);
#define PathIsRelative WINELIB_NAME_AW(PathIsRelative)
BOOL32 WINAPI PathIsRelative32AW(LPCVOID str);
BOOL32 WINAPI PathIsUNC32A(LPCSTR str);
BOOL32 WINAPI PathIsUNC32W(LPCWSTR str);
#define PathIsUNC WINELIB_NAME_AW(PathIsUNC)
BOOL32 WINAPI PathIsUNC32AW(LPCVOID str);
BOOL32 WINAPI PathFindOnPath32A(LPSTR sFile, LPCSTR sOtherDirs);
BOOL32 WINAPI PathFindOnPath32W(LPWSTR sFile, LPCWSTR sOtherDirs);
#define PathFindOnPath WINELIB_NAME_AW(PathFindOnPath)
BOOL32 WINAPI PathFindOnPath32AW(LPVOID sFile, LPCVOID sOtherDirs);
LPSTR WINAPI StrFormatByteSize32A ( DWORD dw, LPSTR pszBuf, UINT32 cchBuf );
LPWSTR WINAPI StrFormatByteSize32W ( DWORD dw, LPWSTR pszBuf, UINT32 cchBuf );
#define StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize)

View File

@ -9,7 +9,7 @@ init Shell32LibMain
2 stdcall SHChangeNotifyRegister(long long long long long long) SHChangeNotifyRegister
3 stub CheckEscapesA@8
4 stdcall SHChangeNotifyDeregister (long long) SHChangeNotifyDeregister
4 stdcall SHChangeNotifyDeregister (long) SHChangeNotifyDeregister
5 stub SHChangeNotifyUpdateEntryList@16
6 stub CheckEscapesW@8
7 stdcall CommandLineToArgvW(wstr ptr) CommandLineToArgvW
@ -44,8 +44,8 @@ init Shell32LibMain
36 stdcall PathAppend(str str) PathAppend
37 stdcall PathCombine(ptr ptr ptr) PathCombine32AW
38 stub PathStripPath
39 stdcall PathIsUNC(str) PathIsUNC
40 stub PathIsRelative@4
39 stdcall PathIsUNC (ptr) PathIsUNC32AW
40 stdcall PathIsRelative (ptr) PathIsRelative32AW
41 stub Control_RunDLLA@16
42 stub Control_RunDLLW@16
43 stdcall PathIsExe (ptr) PathIsExe
@ -102,7 +102,7 @@ init Shell32LibMain
94 stub Win32RemoveDirectory
95 stdcall SHLogILFromFSIL (ptr) SHLogILFromFSIL
96 stdcall StrRetToStrN (long long long long) StrRetToStrN
97 stub SHWaitForFileToOpen
97 stdcall SHWaitForFileToOpen (long long long) SHWaitForFileToOpen
98 stdcall SHGetRealIDL (long long long) SHGetRealIDL
99 stdcall SetAppStartingCursor (long long) SetAppStartingCursor32
100 stdcall SHRestricted(long) SHRestricted
@ -128,7 +128,7 @@ init Shell32LibMain
120 stub FileMenu_AbortInitMenu
121 stdcall SHFlushClipboard () SHFlushClipboard
122 stub RunDLL_CallEntry16
123 stdcall SHFreeUnusedLibraries (long) SHFreeUnusedLibraries
123 stdcall SHFreeUnusedLibraries () SHFreeUnusedLibraries
124 stub FileMenu_AppendFilesForPidl
125 stub FileMenu_AddFilesForPidl
126 stdcall SHOutOfMemoryMessageBox (long long long) SHOutOfMemoryMessageBox
@ -150,7 +150,7 @@ init Shell32LibMain
142 stub FileMenu_DeleteSeparator
143 stub FileMenu_EnableItemByCmd
144 stub FileMenu_GetItemExtent
145 stub PathFindOnPath
145 stdcall PathFindOnPath (ptr ptr) PathFindOnPath32AW
146 stub RLBuildListOfPaths
147 stdcall SHCLSIDFromString(long long) SHCLSIDFromString
148 stdcall ExtractAssociatedIconA(long ptr long) ExtractAssociatedIcon32A # exported by name