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
89640827
Commit
89640827
authored
Jan 06, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Jan 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MsiCloseAllHandles only closes handles allocated in the calling
thread.
parent
25c453aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
handle.c
dlls/msi/handle.c
+37
-13
No files found.
dlls/msi/handle.c
View file @
89640827
...
...
@@ -51,7 +51,13 @@ static CRITICAL_SECTION_DEBUG MSI_object_cs_debug =
};
static
CRITICAL_SECTION
MSI_object_cs
=
{
&
MSI_object_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
MSIOBJECTHDR
*
msihandletable
[
MSIMAXHANDLES
];
typedef
struct
msi_handle_info_t
{
MSIOBJECTHDR
*
obj
;
DWORD
dwThreadId
;
}
msi_handle_info
;
static
msi_handle_info
msihandletable
[
MSIMAXHANDLES
];
MSIHANDLE
alloc_msihandle
(
MSIOBJECTHDR
*
obj
)
{
...
...
@@ -62,13 +68,14 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
/* find a slot */
for
(
i
=
0
;
i
<
MSIMAXHANDLES
;
i
++
)
if
(
!
msihandletable
[
i
]
)
if
(
!
msihandletable
[
i
]
.
obj
)
break
;
if
(
(
i
>=
MSIMAXHANDLES
)
||
msihandletable
[
i
]
)
if
(
(
i
>=
MSIMAXHANDLES
)
||
msihandletable
[
i
]
.
obj
)
goto
out
;
msiobj_addref
(
obj
);
msihandletable
[
i
]
=
obj
;
msihandletable
[
i
].
obj
=
obj
;
msihandletable
[
i
].
dwThreadId
=
GetCurrentThreadId
();
ret
=
(
MSIHANDLE
)
(
i
+
1
);
out:
TRACE
(
"%p -> %ld
\n
"
,
obj
,
ret
);
...
...
@@ -87,13 +94,13 @@ void *msihandle2msiinfo(MSIHANDLE handle, UINT type)
goto
out
;
if
(
handle
>=
MSIMAXHANDLES
)
goto
out
;
if
(
!
msihandletable
[
handle
]
)
if
(
!
msihandletable
[
handle
]
.
obj
)
goto
out
;
if
(
msihandletable
[
handle
]
->
magic
!=
MSIHANDLE_MAGIC
)
if
(
msihandletable
[
handle
]
.
obj
->
magic
!=
MSIHANDLE_MAGIC
)
goto
out
;
if
(
type
&&
(
msihandletable
[
handle
]
->
type
!=
type
)
)
if
(
type
&&
(
msihandletable
[
handle
]
.
obj
->
type
!=
type
)
)
goto
out
;
ret
=
msihandletable
[
handle
];
ret
=
msihandletable
[
handle
]
.
obj
;
msiobj_addref
(
ret
);
out:
...
...
@@ -111,7 +118,7 @@ MSIHANDLE msiobj_findhandle( MSIOBJECTHDR *hdr )
EnterCriticalSection
(
&
MSI_handle_cs
);
for
(
i
=
0
;
(
i
<
MSIMAXHANDLES
)
&&
!
ret
;
i
++
)
if
(
msihandletable
[
i
]
==
hdr
)
if
(
msihandletable
[
i
]
.
obj
==
hdr
)
ret
=
i
+
1
;
LeaveCriticalSection
(
&
MSI_handle_cs
);
...
...
@@ -190,6 +197,9 @@ int msiobj_release( MSIOBJECTHDR *info )
return
ret
;
}
/***********************************************************
* MsiCloseHandle [MSI.@]
*/
UINT
WINAPI
MsiCloseHandle
(
MSIHANDLE
handle
)
{
MSIOBJECTHDR
*
info
;
...
...
@@ -210,7 +220,7 @@ UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
}
msiobj_release
(
info
);
msihandletable
[
handle
-
1
]
=
NULL
;
msihandletable
[
handle
-
1
]
.
obj
=
NULL
;
ret
=
ERROR_SUCCESS
;
TRACE
(
"handle %lx Destroyed
\n
"
,
handle
);
...
...
@@ -222,14 +232,28 @@ out:
return
ret
;
}
/***********************************************************
* MsiCloseAllHandles [MSI.@]
*
* Closes all handles owned by the current thread
*
* RETURNS:
* The number of handles closed
*/
UINT
WINAPI
MsiCloseAllHandles
(
void
)
{
UINT
i
;
UINT
i
,
n
=
0
;
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
MSIMAXHANDLES
;
i
++
)
MsiCloseHandle
(
i
+
1
);
{
if
(
msihandletable
[
i
].
dwThreadId
==
GetCurrentThreadId
())
{
MsiCloseHandle
(
i
+
1
);
n
++
;
}
}
return
0
;
return
n
;
}
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