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
bb8ba38f
Commit
bb8ba38f
authored
Jun 27, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Avoid some redundant checks in MsiCloseHandle.
parent
46158e03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
handle.c
dlls/msi/handle.c
+12
-18
No files found.
dlls/msi/handle.c
View file @
bb8ba38f
...
...
@@ -64,7 +64,7 @@ typedef struct msi_handle_info_t
}
msi_handle_info
;
static
msi_handle_info
*
msihandletable
=
NULL
;
static
int
msihandletable_size
=
0
;
static
unsigned
int
msihandletable_size
=
0
;
void
msi_free_handle_table
(
void
)
{
...
...
@@ -158,8 +158,6 @@ void *msihandle2msiinfo(MSIHANDLE handle, UINT type)
EnterCriticalSection
(
&
MSI_handle_cs
);
handle
--
;
if
(
handle
<
0
)
goto
out
;
if
(
handle
>=
msihandletable_size
)
goto
out
;
if
(
msihandletable
[
handle
].
remote
)
...
...
@@ -185,8 +183,6 @@ IUnknown *msi_get_remote( MSIHANDLE handle )
EnterCriticalSection
(
&
MSI_handle_cs
);
handle
--
;
if
(
handle
<
0
)
goto
out
;
if
(
handle
>=
msihandletable_size
)
goto
out
;
if
(
!
msihandletable
[
handle
].
remote
)
...
...
@@ -273,7 +269,6 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
{
MSIOBJECTHDR
*
info
=
NULL
;
UINT
ret
=
ERROR_INVALID_HANDLE
;
IUnknown
*
unk
;
TRACE
(
"%lx
\n
"
,
handle
);
...
...
@@ -282,16 +277,17 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
EnterCriticalSection
(
&
MSI_handle_cs
);
unk
=
msi_get_remote
(
handle
);
if
(
unk
)
handle
--
;
if
(
handle
>=
msihandletable_size
)
goto
out
;
if
(
msihandletable
[
handle
].
remote
)
{
/* release once for handle, once for table entry */
IUnknown_Release
(
unk
);
IUnknown_Release
(
unk
);
IUnknown_Release
(
msihandletable
[
handle
].
u
.
unk
);
}
else
{
info
=
msihandle
2msiinfo
(
handle
,
0
)
;
info
=
msihandle
table
[
handle
].
u
.
obj
;
if
(
!
info
)
goto
out
;
...
...
@@ -300,17 +296,15 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
ERR
(
"Invalid handle!
\n
"
);
goto
out
;
}
msiobj_release
(
info
);
}
msihandletable
[
handle
-
1
].
u
.
obj
=
NULL
;
msihandletable
[
handle
-
1
].
remote
=
0
;
msihandletable
[
handle
-
1
].
dwThreadId
=
0
;
msihandletable
[
handle
].
u
.
obj
=
NULL
;
msihandletable
[
handle
].
remote
=
0
;
msihandletable
[
handle
].
dwThreadId
=
0
;
ret
=
ERROR_SUCCESS
;
TRACE
(
"handle %lx
Destroyed
\n
"
,
handle
);
TRACE
(
"handle %lx
destroyed
\n
"
,
handle
+
1
);
out:
LeaveCriticalSection
(
&
MSI_handle_cs
);
if
(
info
)
...
...
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