Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
cb782195
Commit
cb782195
authored
25 years ago
by
Juergen Schmied
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
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
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/shell32/iconcache.c
+17
-14
17 additions, 14 deletions
dlls/shell32/iconcache.c
dlls/shell32/shell32_main.c
+16
-5
16 additions, 5 deletions
dlls/shell32/shell32_main.c
dlls/shell32/shell32_main.h
+6
-8
6 additions, 8 deletions
dlls/shell32/shell32_main.h
with
39 additions
and
27 deletions
dlls/shell32/iconcache.c
+
17
−
14
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]
...
...
This diff is collapsed.
Click to expand it.
dlls/shell32/shell32_main.c
+
16
−
5
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
)
...
...
This diff is collapsed.
Click to expand it.
dlls/shell32/shell32_main.h
+
6
−
8
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment