Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
77b7f957
Commit
77b7f957
authored
Jun 18, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ole32 a delay-load import of shell32.
parent
2ed053b5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
155 deletions
+28
-155
Makefile.in
dlls/shell32/Makefile.in
+2
-2
clipboard.c
dlls/shell32/clipboard.c
+0
-37
shell32_main.h
dlls/shell32/shell32_main.h
+0
-14
shellole.c
dlls/shell32/shellole.c
+8
-31
shellord.c
dlls/shell32/shellord.c
+3
-6
shlview.c
dlls/shell32/shlview.c
+6
-14
shv_bg_cmenu.c
dlls/shell32/shv_bg_cmenu.c
+2
-2
shv_item_cmenu.c
dlls/shell32/shv_item_cmenu.c
+7
-49
No files found.
dlls/shell32/Makefile.in
View file @
77b7f957
...
...
@@ -4,8 +4,8 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
shell32.dll
# fixme: avoid ole32.dll import
IMPORTS
=
ole32 shlwapi comctl32 user32 gdi32 advapi32 kernel
32
IMPORTS
=
shlwapi comctl32 user32 gdi32 advapi32 kernel32
DELAYIMPORTS
=
ole
32
ALTNAMES
=
shell.dll
EXTRALIBS
=
-luuid
$(LIBUNICODE)
...
...
dlls/shell32/clipboard.c
View file @
77b7f957
...
...
@@ -52,43 +52,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
HRESULT
(
WINAPI
*
pOleInitialize
)(
LPVOID
reserved
);
void
(
WINAPI
*
pOleUninitialize
)(
void
);
HRESULT
(
WINAPI
*
pRegisterDragDrop
)(
HWND
hwnd
,
IDropTarget
*
pDropTarget
);
HRESULT
(
WINAPI
*
pRevokeDragDrop
)(
HWND
hwnd
);
HRESULT
(
WINAPI
*
pDoDragDrop
)(
LPDATAOBJECT
,
LPDROPSOURCE
,
DWORD
,
DWORD
*
);
void
(
WINAPI
*
pReleaseStgMedium
)(
STGMEDIUM
*
pmedium
);
HRESULT
(
WINAPI
*
pOleSetClipboard
)(
IDataObject
*
pDataObj
);
HRESULT
(
WINAPI
*
pOleGetClipboard
)(
IDataObject
**
ppDataObj
);
/**************************************************************************
* GetShellOle
*
* make sure OLE32.DLL is loaded
*/
BOOL
GetShellOle
(
void
)
{
static
HANDLE
hOle32
=
NULL
;
if
(
!
hOle32
)
{
hOle32
=
LoadLibraryA
(
"ole32.dll"
);
if
(
hOle32
)
{
pOleInitialize
=
(
void
*
)
GetProcAddress
(
hOle32
,
"OleInitialize"
);
pOleUninitialize
=
(
void
*
)
GetProcAddress
(
hOle32
,
"OleUninitialize"
);
pRegisterDragDrop
=
(
void
*
)
GetProcAddress
(
hOle32
,
"RegisterDragDrop"
);
pRevokeDragDrop
=
(
void
*
)
GetProcAddress
(
hOle32
,
"RevokeDragDrop"
);
pDoDragDrop
=
(
void
*
)
GetProcAddress
(
hOle32
,
"DoDragDrop"
);
pReleaseStgMedium
=
(
void
*
)
GetProcAddress
(
hOle32
,
"ReleaseStgMedium"
);
pOleSetClipboard
=
(
void
*
)
GetProcAddress
(
hOle32
,
"OleSetClipboard"
);
pOleGetClipboard
=
(
void
*
)
GetProcAddress
(
hOle32
,
"OleGetClipboard"
);
pOleInitialize
(
NULL
);
}
}
return
TRUE
;
}
/**************************************************************************
* RenderHDROP
*
...
...
dlls/shell32/shell32_main.h
View file @
77b7f957
...
...
@@ -131,20 +131,6 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI
/* Systray */
BOOL
SYSTRAY_Init
(
void
);
/* OLE32 */
extern
HINSTANCE
hShellOle32
;
extern
HRESULT
(
WINAPI
*
pOleInitialize
)(
LPVOID
reserved
);
extern
void
(
WINAPI
*
pOleUninitialize
)(
void
);
extern
HRESULT
(
WINAPI
*
pRegisterDragDrop
)(
HWND
hwnd
,
IDropTarget
*
pDropTarget
);
extern
HRESULT
(
WINAPI
*
pRevokeDragDrop
)(
HWND
hwnd
);
extern
HRESULT
(
WINAPI
*
pDoDragDrop
)(
LPDATAOBJECT
,
LPDROPSOURCE
,
DWORD
,
DWORD
*
);
extern
void
(
WINAPI
*
pReleaseStgMedium
)(
STGMEDIUM
*
pmedium
);
extern
HRESULT
(
WINAPI
*
pOleSetClipboard
)(
IDataObject
*
pDataObj
);
extern
HRESULT
(
WINAPI
*
pOleGetClipboard
)(
IDataObject
**
ppDataObj
);
extern
HRESULT
(
WINAPI
*
pCoCreateInstance
)(
REFCLSID
rclsid
,
LPUNKNOWN
pUnkOuter
,
DWORD
dwClsContext
,
REFIID
iid
,
LPVOID
*
ppv
);
BOOL
GetShellOle
(
void
);
HGLOBAL
RenderHDROP
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
);
HGLOBAL
RenderSHELLIDLIST
(
LPITEMIDLIST
pidlRoot
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
);
...
...
dlls/shell32/shellole.c
View file @
77b7f957
...
...
@@ -73,30 +73,6 @@ struct {
};
/*************************************************************************
* __CoCreateInstance [internal]
*
* NOTES
* wraper for late bound call to OLE32.DLL
*
*/
HRESULT
(
WINAPI
*
pCoCreateInstance
)(
REFCLSID
rclsid
,
LPUNKNOWN
pUnkOuter
,
DWORD
dwClsContext
,
REFIID
iid
,
LPVOID
*
ppv
)
=
NULL
;
void
*
__GetExternalFunc
(
HMODULE
*
phModule
,
LPCWSTR
szModuleName
,
LPCSTR
szProcName
)
{
if
(
!*
phModule
)
*
phModule
=
GetModuleHandleW
(
szModuleName
);
if
(
!*
phModule
)
*
phModule
=
LoadLibraryW
(
szModuleName
);
if
(
*
phModule
)
return
GetProcAddress
(
*
phModule
,
szProcName
);
return
NULL
;
}
HRESULT
__CoCreateInstance
(
REFCLSID
rclsid
,
LPUNKNOWN
pUnkOuter
,
DWORD
dwClsContext
,
REFIID
iid
,
LPVOID
*
ppv
)
{
if
(
!
pCoCreateInstance
)
pCoCreateInstance
=
__GetExternalFunc
(
&
hShellOle32
,
sOLE32
,
"CoCreateInstance"
);
if
(
!
pCoCreateInstance
)
return
E_FAIL
;
return
pCoCreateInstance
(
rclsid
,
pUnkOuter
,
dwClsContext
,
iid
,
ppv
);
}
/*************************************************************************
* SHCoCreateInstance [SHELL32.102]
*
* NOTES
...
...
@@ -212,7 +188,7 @@ LRESULT WINAPI SHCoCreateInstance(
}
else
{
/* load a external dll in the usual way */
hres
=
__
CoCreateInstance
(
myclsid
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
refiid
,
ppv
);
hres
=
CoCreateInstance
(
myclsid
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
refiid
,
ppv
);
goto
end
;
}
...
...
@@ -438,17 +414,18 @@ static ICOM_VTABLE(IMalloc) VT_Shell_IMalloc32 =
*/
HRESULT
WINAPI
SHGetMalloc
(
LPMALLOC
*
lpmal
)
{
HRESULT
(
WINAPI
*
pCoGetMalloc
)(
DWORD
,
LPMALLOC
*
);
HMODULE
hOle32
;
TRACE
(
"(%p)
\n
"
,
lpmal
);
if
(
!
ShellTaskAllocator
)
{
hOle32
=
GetModuleHandleA
(
"OLE32.DLL"
);
HMODULE
hOle32
=
GetModuleHandleA
(
"OLE32.DLL"
);
/* this is very suspect. we should not being using a different
* allocator from deallocator based on something undeterministic
* like whether ole32 is loaded. as it happens currently, they
* both map to the same allocator deep down, but this could
* change in the future. */
if
(
hOle32
)
{
pCoGetMalloc
=
(
void
*
)
GetProcAddress
(
hOle32
,
"CoGetMalloc"
);
if
(
pCoGetMalloc
)
pCoGetMalloc
(
MEMCTX_TASK
,
&
ShellTaskAllocator
);
CoGetMalloc
(
MEMCTX_TASK
,
&
ShellTaskAllocator
);
TRACE
(
"got ole32 IMalloc
\n
"
);
}
if
(
!
ShellTaskAllocator
)
{
...
...
dlls/shell32/shellord.c
View file @
77b7f957
...
...
@@ -424,8 +424,7 @@ HRESULT WINAPI SHRegisterDragDrop(
LPDROPTARGET
pDropTarget
)
{
FIXME
(
"(%p,%p):stub.
\n
"
,
hWnd
,
pDropTarget
);
if
(
GetShellOle
())
return
pRegisterDragDrop
(
hWnd
,
pDropTarget
);
return
0
;
return
RegisterDragDrop
(
hWnd
,
pDropTarget
);
}
/*************************************************************************
...
...
@@ -437,8 +436,7 @@ HRESULT WINAPI SHRegisterDragDrop(
HRESULT
WINAPI
SHRevokeDragDrop
(
HWND
hWnd
)
{
FIXME
(
"(%p):stub.
\n
"
,
hWnd
);
if
(
GetShellOle
())
return
pRevokeDragDrop
(
hWnd
);
return
0
;
return
RevokeDragDrop
(
hWnd
);
}
/*************************************************************************
...
...
@@ -456,8 +454,7 @@ HRESULT WINAPI SHDoDragDrop(
{
FIXME
(
"(%p %p %p 0x%08lx %p):stub.
\n
"
,
hWnd
,
lpDataObject
,
lpDropSource
,
dwOKEffect
,
pdwEffect
);
if
(
GetShellOle
())
return
pDoDragDrop
(
lpDataObject
,
lpDropSource
,
dwOKEffect
,
pdwEffect
);
return
0
;
return
DoDragDrop
(
lpDataObject
,
lpDropSource
,
dwOKEffect
,
pdwEffect
);
}
/*************************************************************************
...
...
dlls/shell32/shlview.c
View file @
77b7f957
...
...
@@ -656,13 +656,10 @@ static LRESULT ShellView_OnCreate(IShellViewImpl * This)
}
}
if
(
GetShellOle
()
&&
pRegisterDragDrop
)
if
(
SUCCEEDED
(
IShellFolder_CreateViewObject
(
This
->
pSFParent
,
This
->
hWnd
,
&
IID_IDropTarget
,
(
LPVOID
*
)
&
pdt
))
)
{
if
(
SUCCEEDED
(
IShellFolder_CreateViewObject
(
This
->
pSFParent
,
This
->
hWnd
,
&
IID_IDropTarget
,
(
LPVOID
*
)
&
pdt
)))
{
pRegisterDragDrop
(
This
->
hWnd
,
pdt
);
RegisterDragDrop
(
This
->
hWnd
,
pdt
);
IDropTarget_Release
(
pdt
);
}
}
/* register for receiving notifications */
...
...
@@ -1231,10 +1228,8 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
DWORD
dwAttributes
=
SFGAO_CANLINK
;
DWORD
dwEffect
=
DROPEFFECT_COPY
|
DROPEFFECT_MOVE
;
if
(
GetShellOle
()
&&
pDoDragDrop
)
if
(
SUCCEEDED
(
IShellFolder_GetUIObjectOf
(
This
->
pSFParent
,
This
->
hWnd
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
IID_IDataObject
,
0
,(
LPVOID
*
)
&
pda
))
)
{
if
(
SUCCEEDED
(
IShellFolder_GetUIObjectOf
(
This
->
pSFParent
,
This
->
hWnd
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
IID_IDataObject
,
0
,(
LPVOID
*
)
&
pda
)))
{
IDropSource
*
pds
=
(
IDropSource
*
)
&
(
This
->
lpvtblDropSource
);
/* own DropSource interface */
if
(
SUCCEEDED
(
IShellFolder_GetAttributesOf
(
This
->
pSFParent
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
dwAttributes
)))
...
...
@@ -1248,10 +1243,9 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
if
(
pds
)
{
DWORD
dwEffect
;
p
DoDragDrop
(
pda
,
pds
,
dwEffect
,
&
dwEffect
);
DoDragDrop
(
pda
,
pds
,
dwEffect
,
&
dwEffect
);
}
IDataObject_Release
(
pda
);
}
}
}
break
;
...
...
@@ -1456,10 +1450,8 @@ static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wPara
case
WM_GETDLGCODE
:
return
SendMessageA
(
pThis
->
hWndList
,
uMessage
,
0
,
0
);
case
WM_DESTROY
:
if
(
GetShellOle
()
&&
pRevokeDragDrop
)
{
pRevokeDragDrop
(
pThis
->
hWnd
);
}
case
WM_DESTROY
:
RevokeDragDrop
(
pThis
->
hWnd
);
SHChangeNotifyDeregister
(
pThis
->
hNotify
);
break
;
...
...
dlls/shell32/shv_bg_cmenu.c
View file @
77b7f957
...
...
@@ -223,7 +223,7 @@ static BOOL DoPaste(
TRACE
(
"
\n
"
);
if
(
SUCCEEDED
(
p
OleGetClipboard
(
&
pda
)))
if
(
SUCCEEDED
(
OleGetClipboard
(
&
pda
)))
{
STGMEDIUM
medium
;
FORMATETC
formatetc
;
...
...
@@ -277,7 +277,7 @@ static BOOL DoPaste(
SHFree
(
pidl
);
/* release the medium*/
p
ReleaseStgMedium
(
&
medium
);
ReleaseStgMedium
(
&
medium
);
}
IDataObject_Release
(
pda
);
}
...
...
dlls/shell32/shv_item_cmenu.c
View file @
77b7f957
...
...
@@ -362,62 +362,20 @@ static BOOL DoCopyOrCut(
TRACE
(
"(%p)->(wnd=%p,bCut=0x%08x)
\n
"
,
This
,
hwnd
,
bCut
);
if
(
GetShellOle
())
/* get the active IShellView */
if
((
lpSB
=
(
LPSHELLBROWSER
)
SendMessageA
(
hwnd
,
CWM_GETISHELLBROWSER
,
0
,
0
)))
{
/* get the active IShellView */
if
((
lpSB
=
(
LPSHELLBROWSER
)
SendMessageA
(
hwnd
,
CWM_GETISHELLBROWSER
,
0
,
0
)))
if
(
SUCCEEDED
(
IShellBrowser_QueryActiveShellView
(
lpSB
,
&
lpSV
)))
{
if
(
SUCCEEDED
(
IShell
Browser_QueryActiveShellView
(
lpSB
,
&
lpSV
)))
if
(
SUCCEEDED
(
IShell
View_GetItemObject
(
lpSV
,
SVGIO_SELECTION
,
&
IID_IDataObject
,
(
LPVOID
*
)
&
lpDo
)))
{
if
(
SUCCEEDED
(
IShellView_GetItemObject
(
lpSV
,
SVGIO_SELECTION
,
&
IID_IDataObject
,
(
LPVOID
*
)
&
lpDo
)))
{
pOleSetClipboard
(
lpDo
);
IDataObject_Release
(
lpDo
);
}
IShellView_Release
(
lpSV
);
OleSetClipboard
(
lpDo
);
IDataObject_Release
(
lpDo
);
}
IShellView_Release
(
lpSV
);
}
}
return
TRUE
;
#if 0
/*
the following code does the copy operation witout ole32.dll
we might need this possibility too (js)
*/
BOOL bSuccess = FALSE;
TRACE("(%p)\n", iface);
if(OpenClipboard(NULL))
{
if(EmptyClipboard())
{
IPersistFolder2 * ppf2;
IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppf2);
if (ppf2)
{
LPITEMIDLIST pidl;
IPersistFolder2_GetCurFolder(ppf2, &pidl);
if(pidl)
{
HGLOBAL hMem;
hMem = RenderHDROP(pidl, This->apidl, This->cidl);
if(SetClipboardData(CF_HDROP, hMem))
{
bSuccess = TRUE;
}
SHFree(pidl);
}
IPersistFolder2_Release(ppf2);
}
}
CloseClipboard();
}
return bSuccess;
#endif
}
/**************************************************************************
* ISvItemCm_fnInvokeCommand()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment