Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
cb782195
Commit
cb782195
authored
Jul 10, 1999
by
Juergen Schmied
Committed by
Alexandre Julliard
Jul 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed crash during second DLL_PROCESS_DETACH if the dll
refcount reached zero after the second one (memory freed twice).
parent
e80d3d7c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
iconcache.c
dlls/shell32/iconcache.c
+17
-14
shell32_main.c
dlls/shell32/shell32_main.c
+16
-5
shell32_main.h
dlls/shell32/shell32_main.h
+6
-8
No files found.
dlls/shell32/iconcache.c
View file @
cb782195
...
...
@@ -446,9 +446,6 @@ end_1: _lclose( hFile);
}
/********************** THE ICON CACHE ********************************/
HIMAGELIST
ShellSmallIconList
=
0
;
HIMAGELIST
ShellBigIconList
=
0
;
HDPA
hdpa
=
0
;
#define INVALID_INDEX -1
...
...
@@ -494,7 +491,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
lpsice
->
sSourceFile
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
PathFindFilenameA
(
sSourceFile
));
lpsice
->
dwSourceIndex
=
dwSourceIndex
;
index
=
pDPA_InsertPtr
(
hdpa
,
0x7fff
,
lpsice
);
index
=
pDPA_InsertPtr
(
sic_
hdpa
,
0x7fff
,
lpsice
);
if
(
INVALID_INDEX
==
index
)
{
SHFree
(
lpsice
);
return
INVALID_INDEX
;
...
...
@@ -551,8 +548,8 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
sice
.
sSourceFile
=
PathFindFilenameA
(
sSourceFile
);
sice
.
dwSourceIndex
=
dwSourceIndex
;
if
(
NULL
!=
pDPA_GetPtr
(
hdpa
,
0
))
{
index
=
pDPA_Search
(
hdpa
,
&
sice
,
-
1L
,
SIC_CompareEntrys
,
0
,
0
);
if
(
NULL
!=
pDPA_GetPtr
(
sic_
hdpa
,
0
))
{
index
=
pDPA_Search
(
sic_
hdpa
,
&
sice
,
-
1L
,
SIC_CompareEntrys
,
0
,
0
);
}
if
(
INVALID_INDEX
==
index
)
...
...
@@ -560,7 +557,7 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
}
TRACE
(
"-- found
\n
"
);
return
((
LPSIC_ENTRY
)
pDPA_GetPtr
(
hdpa
,
index
))
->
dwListIndex
;
return
((
LPSIC_ENTRY
)
pDPA_GetPtr
(
sic_
hdpa
,
index
))
->
dwListIndex
;
}
/****************************************************************************
* SIC_LoadIcon [internal]
...
...
@@ -598,12 +595,12 @@ BOOL SIC_Initialize(void)
TRACE
(
"
\n
"
);
if
(
hdpa
)
/* already initialized?*/
if
(
sic_
hdpa
)
/* already initialized?*/
return
TRUE
;
hdpa
=
pDPA_Create
(
16
);
sic_
hdpa
=
pDPA_Create
(
16
);
if
(
!
hdpa
)
if
(
!
sic_
hdpa
)
{
return
(
FALSE
);
}
...
...
@@ -652,13 +649,19 @@ void SIC_Destroy(void)
LPSIC_ENTRY
lpsice
;
int
i
;
if
(
hdpa
&&
NULL
!=
pDPA_GetPtr
(
hdpa
,
0
))
{
for
(
i
=
0
;
i
<
pDPA_GetPtrCount
(
hdpa
);
++
i
)
{
lpsice
=
pDPA_GetPtr
(
hdpa
,
i
);
TRACE
(
"
\n
"
);
if
(
sic_hdpa
&&
NULL
!=
pDPA_GetPtr
(
sic_hdpa
,
0
))
{
for
(
i
=
0
;
i
<
pDPA_GetPtrCount
(
sic_hdpa
);
++
i
)
{
lpsice
=
pDPA_GetPtr
(
sic_hdpa
,
i
);
SHFree
(
lpsice
);
}
pDPA_Destroy
(
hdpa
);
pDPA_Destroy
(
sic_
hdpa
);
}
sic_hdpa
=
NULL
;
}
/*************************************************************************
* Shell_GetImageList [SHELL32.71]
...
...
dlls/shell32/shell32_main.c
View file @
cb782195
...
...
@@ -416,7 +416,7 @@ DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *shellfolder)
{
hres
=
NOERROR
;
}
else
{
lpclf
=
IClassFactory_Constructor
();
{
lpclf
=
IClassFactory_Constructor
(
&
CLSID_ShellDesktop
);
if
(
lpclf
)
{
hres
=
IClassFactory_CreateInstance
(
lpclf
,
NULL
,(
REFIID
)
&
IID_IShellFolder
,
(
void
*
)
&
pdesktopfolder
);
IClassFactory_Release
(
lpclf
);
...
...
@@ -1058,6 +1058,7 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
}
/*************************************************************************
* global variables of the shell32.dll
* all are once per process
*
*/
void
(
WINAPI
*
pDLLInitComctl
)(
LPVOID
);
...
...
@@ -1089,6 +1090,11 @@ static INT shell32_RefCount = 0;
INT
shell32_ObjCount
=
0
;
HINSTANCE
shell32_hInstance
;
HIMAGELIST
ShellSmallIconList
=
0
;
HIMAGELIST
ShellBigIconList
=
0
;
HDPA
sic_hdpa
=
0
;
/*************************************************************************
* SHELL32 LibMain
*
...
...
@@ -1102,12 +1108,16 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
shell32_hInstance
=
hinstDLL
;
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
{
case
DLL_PROCESS_ATTACH
:
if
(
!
bShell32IsInitialized
)
{
hComctl32
=
LoadLibraryA
(
"COMCTL32.DLL"
);
{
hComctl32
=
LoadLibraryA
(
"COMCTL32.DLL"
);
hUser32
=
GetModuleHandleA
(
"USER32"
);
if
(
hComctl32
&&
hUser32
)
{
pDLLInitComctl
=
(
void
*
)
GetProcAddress
(
hComctl32
,
"InitCommonControlsEx"
);
{
pDLLInitComctl
=
(
void
*
)
GetProcAddress
(
hComctl32
,
"InitCommonControlsEx"
);
if
(
pDLLInitComctl
)
{
pDLLInitComctl
(
NULL
);
}
...
...
@@ -1158,10 +1168,11 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
if
(
pdesktopfolder
)
{
IShellFolder_Release
(
pdesktopfolder
);
pdesktopfolder
=
NULL
;
}
SIC_Destroy
();
FreeLibrary
(
hComctl32
);
FreeLibrary
(
hComctl32
);
/* this one is here to check if AddRef/Release is balanced */
if
(
shell32_ObjCount
)
...
...
dlls/shell32/shell32_main.h
View file @
cb782195
...
...
@@ -22,8 +22,9 @@
*/
extern
HINSTANCE
shell32_hInstance
;
extern
INT
shell32_ObjCount
;
extern
HIMAGELIST
ShellSmallIconList
;
extern
HIMAGELIST
ShellBigIconList
;
extern
HIMAGELIST
ShellSmallIconList
;
extern
HIMAGELIST
ShellBigIconList
;
extern
HDPA
sic_hdpa
;
/*******************************************
* pointer to functions dynamically loaded
...
...
@@ -95,16 +96,13 @@ HANDLE WINAPI SHFreeShared(HANDLE hmem, DWORD procID);
extern
LPDATAOBJECT
IDataObject_Constructor
(
HWND
hwndOwner
,
LPSHELLFOLDER
psf
,
LPITEMIDLIST
*
apidl
,
UINT
cidl
);
extern
LPENUMFORMATETC
IEnumFORMATETC_Constructor
(
UINT
,
const
FORMATETC
[]);
extern
LPCLASSFACTORY
IShellLink_CF_Constructor
(
void
);
extern
LPCLASSFACTORY
IShellLinkW_CF_Constructor
(
void
);
extern
LPCLASSFACTORY
IClassFactory_Constructor
(
void
);
extern
LPCLASSFACTORY
IClassFactory_Constructor
(
REFCLSID
);
extern
LPCONTEXTMENU
IContextMenu_Constructor
(
LPSHELLFOLDER
,
LPCITEMIDLIST
*
,
UINT
);
extern
LPSHELLVIEW
IShellView_Constructor
(
LPSHELLFOLDER
,
LPCITEMIDLIST
);
extern
LPSHELLLINK
IShellLink_Constructor
(
void
);
extern
LPSHELLLINKW
IShellLinkW_Constructor
(
void
);
extern
LPSHELLLINK
IShellLink_Constructor
(
BOOL
);
extern
LPENUMIDLIST
IEnumIDList_Constructor
(
LPCSTR
,
DWORD
);
extern
LPEXTRACTICONA
IExtractIconA_Constructor
(
LPITEMIDLIST
);
extern
HRESULT
CreateStreamOnFile
(
LPCSTR
pszFilename
,
IStream
**
ppstm
);
/* fixme: rename the functions when the shell32.dll has it's own exports namespace */
HRESULT
WINAPI
SHELL32_DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
);
...
...
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