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
e3cfd6ef
Commit
e3cfd6ef
authored
Sep 12, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Remove class cache introduced in commit
f686cfab
.
parent
260a949f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
99 deletions
+2
-99
shlfolder.c
dlls/shell32/shlfolder.c
+2
-99
No files found.
dlls/shell32/shlfolder.c
View file @
e3cfd6ef
...
...
@@ -50,28 +50,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
static
CRITICAL_SECTION
SHELL32_SF_ClassCacheCS
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
{
0
,
0
,
&
SHELL32_SF_ClassCacheCS
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": SHELL32_SF_ClassCacheCS"
)
}
};
static
CRITICAL_SECTION
SHELL32_SF_ClassCacheCS
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
/* IShellFolder class cache */
struct
_sf_cls_cache_entry
{
CLSID
clsid
;
LPVOID
pv
;
};
static
struct
_sf_class_cache
{
DWORD
allocated
,
used
;
struct
_sf_cls_cache_entry
*
sf_cls_cache_entry
;
}
sf_cls_cache
;
static
const
WCHAR
wszDotShellClassInfo
[]
=
{
'.'
,
'S'
,
'h'
,
'e'
,
'l'
,
'l'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
...
...
@@ -204,70 +182,6 @@ HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
return
hr
;
}
static
BOOL
get_iface_from_cache
(
REFCLSID
clsid
,
LPVOID
*
ppvOut
)
{
BOOL
ret
=
FALSE
;
int
i
;
EnterCriticalSection
(
&
SHELL32_SF_ClassCacheCS
);
for
(
i
=
0
;
i
<
sf_cls_cache
.
used
;
i
++
)
{
if
(
IsEqualIID
(
&
sf_cls_cache
.
sf_cls_cache_entry
[
i
].
clsid
,
clsid
))
{
*
ppvOut
=
sf_cls_cache
.
sf_cls_cache_entry
[
i
].
pv
;
/* Pin it */
IUnknown_AddRef
((
IUnknown
*
)
*
ppvOut
);
ret
=
TRUE
;
break
;
}
}
LeaveCriticalSection
(
&
SHELL32_SF_ClassCacheCS
);
return
ret
;
}
static
void
add_iface_to_cache
(
REFCLSID
clsid
,
LPVOID
pv
)
{
EnterCriticalSection
(
&
SHELL32_SF_ClassCacheCS
);
if
(
sf_cls_cache
.
used
>=
sf_cls_cache
.
allocated
)
{
DWORD
allocated
;
struct
_sf_cls_cache_entry
*
sf_cls_cache_entry
;
if
(
!
sf_cls_cache
.
allocated
)
{
allocated
=
4
;
sf_cls_cache_entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
4
*
sizeof
(
*
sf_cls_cache_entry
));
}
else
{
allocated
=
sf_cls_cache
.
allocated
*
2
;
sf_cls_cache_entry
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
sf_cls_cache
.
sf_cls_cache_entry
,
allocated
*
sizeof
(
*
sf_cls_cache_entry
));
}
if
(
!
sf_cls_cache_entry
)
{
LeaveCriticalSection
(
&
SHELL32_SF_ClassCacheCS
);
return
;
}
sf_cls_cache
.
allocated
=
allocated
;
sf_cls_cache
.
sf_cls_cache_entry
=
sf_cls_cache_entry
;
}
/* Pin it */
IUnknown_AddRef
((
IUnknown
*
)
pv
);
sf_cls_cache
.
sf_cls_cache_entry
[
sf_cls_cache
.
used
].
clsid
=
*
clsid
;
sf_cls_cache
.
sf_cls_cache_entry
[
sf_cls_cache
.
used
].
pv
=
pv
;
sf_cls_cache
.
used
++
;
LeaveCriticalSection
(
&
SHELL32_SF_ClassCacheCS
);
}
/***********************************************************************
* SHELL32_CoCreateInitSF
*
...
...
@@ -281,22 +195,11 @@ static void add_iface_to_cache(REFCLSID clsid, LPVOID pv)
static
HRESULT
SHELL32_CoCreateInitSF
(
LPCITEMIDLIST
pidlRoot
,
LPCWSTR
pathRoot
,
LPCITEMIDLIST
pidlChild
,
REFCLSID
clsid
,
LPVOID
*
ppvOut
)
{
HRESULT
hr
=
S_OK
;
HRESULT
hr
;
TRACE
(
"%p %s %p
\n
"
,
pidlRoot
,
debugstr_w
(
pathRoot
),
pidlChild
);
if
(
!
get_iface_from_cache
(
clsid
,
ppvOut
))
{
hr
=
SHCoCreateInstance
(
NULL
,
clsid
,
NULL
,
&
IID_IShellFolder
,
ppvOut
);
if
(
SUCCEEDED
(
hr
))
{
TRACE
(
"loaded %p %s
\n
"
,
*
ppvOut
,
wine_dbgstr_guid
(
clsid
));
add_iface_to_cache
(
clsid
,
*
ppvOut
);
}
}
else
TRACE
(
"found in the cache %p %s
\n
"
,
*
ppvOut
,
wine_dbgstr_guid
(
clsid
));
hr
=
SHCoCreateInstance
(
NULL
,
clsid
,
NULL
,
&
IID_IShellFolder
,
ppvOut
);
if
(
SUCCEEDED
(
hr
))
{
LPITEMIDLIST
pidlAbsolute
=
ILCombine
(
pidlRoot
,
pidlChild
);
...
...
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