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
29f0803c
Commit
29f0803c
authored
Aug 28, 2006
by
Dan Kegel
Committed by
Alexandre Julliard
Aug 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Remove limit on number of handles.
parent
98ec9399
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
13 deletions
+30
-13
handle.c
dlls/msi/handle.c
+29
-6
msipriv.h
dlls/msi/msipriv.h
+0
-1
db.c
dlls/msi/tests/db.c
+1
-6
No files found.
dlls/msi/handle.c
View file @
29f0803c
...
...
@@ -57,7 +57,8 @@ typedef struct msi_handle_info_t
DWORD
dwThreadId
;
}
msi_handle_info
;
static
msi_handle_info
msihandletable
[
MSIMAXHANDLES
];
static
msi_handle_info
*
msihandletable
=
NULL
;
static
int
msihandletable_size
=
0
;
MSIHANDLE
alloc_msihandle
(
MSIOBJECTHDR
*
obj
)
{
...
...
@@ -67,11 +68,29 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
EnterCriticalSection
(
&
MSI_handle_cs
);
/* find a slot */
for
(
i
=
0
;
i
<
MSIMAXHANDLES
;
i
++
)
for
(
i
=
0
;
i
<
msihandletable_size
;
i
++
)
if
(
!
msihandletable
[
i
].
obj
)
break
;
if
(
(
i
>=
MSIMAXHANDLES
)
||
msihandletable
[
i
].
obj
)
goto
out
;
if
(
i
==
msihandletable_size
)
{
msi_handle_info
*
p
;
int
newsize
;
if
(
msihandletable_size
==
0
)
{
newsize
=
256
;
p
=
msi_alloc_zero
(
newsize
*
sizeof
(
msi_handle_info
));
}
else
{
newsize
=
msihandletable_size
*
2
;
p
=
msi_realloc_zero
(
msihandletable
,
newsize
*
sizeof
(
msi_handle_info
));
}
if
(
!
p
)
goto
out
;
msihandletable
=
p
;
msihandletable_size
=
newsize
;
}
msiobj_addref
(
obj
);
msihandletable
[
i
].
obj
=
obj
;
...
...
@@ -92,7 +111,7 @@ void *msihandle2msiinfo(MSIHANDLE handle, UINT type)
handle
--
;
if
(
handle
<
0
)
goto
out
;
if
(
handle
>=
MSIMAXHANDLES
)
if
(
handle
>=
msihandletable_size
)
goto
out
;
if
(
!
msihandletable
[
handle
].
obj
)
goto
out
;
...
...
@@ -230,14 +249,18 @@ UINT WINAPI MsiCloseAllHandles(void)
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
MSIMAXHANDLES
;
i
++
)
EnterCriticalSection
(
&
MSI_handle_cs
);
for
(
i
=
0
;
i
<
msihandletable_size
;
i
++
)
{
if
(
msihandletable
[
i
].
dwThreadId
==
GetCurrentThreadId
())
{
LeaveCriticalSection
(
&
MSI_handle_cs
);
MsiCloseHandle
(
i
+
1
);
EnterCriticalSection
(
&
MSI_handle_cs
);
n
++
;
}
}
LeaveCriticalSection
(
&
MSI_handle_cs
);
return
n
;
}
dlls/msi/msipriv.h
View file @
29f0803c
...
...
@@ -271,7 +271,6 @@ typedef struct tagMSISUMMARYINFO
#define GUID_SIZE 39
#define MSIHANDLE_MAGIC 0x4d434923
#define MSIMAXHANDLES 0xf0
DEFINE_GUID
(
CLSID_IMsiServer
,
0x000C101C
,
0x0000
,
0x0000
,
0xC0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
DEFINE_GUID
(
CLSID_IMsiServerX1
,
0x000C103E
,
0x0000
,
0x0000
,
0xC0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
...
...
dlls/msi/tests/db.c
View file @
29f0803c
...
...
@@ -1376,12 +1376,7 @@ static void test_handle_limit(void)
r
=
MsiDatabaseOpenView
(
hdb
,
szQueryBuf
,
&
hviews
[
i
]);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open query %d
\n
"
,
i
);
ok
(
hviews
[
i
]
!=
0xdeadbeeb
,
"no handle set
\n
"
);
if
(
i
<
0xef
)
ok
(
hviews
[
i
]
!=
0
,
"%d'th handle is NULL
\n
"
,
i
);
else
todo_wine
{
ok
(
hviews
[
i
]
!=
0
,
"%d'th handle is NULL
\n
"
,
i
);
}
ok
(
hviews
[
i
]
!=
0
,
"%d'th handle is NULL
\n
"
,
i
);
if
(
!
hviews
[
i
])
break
;
ok
(
(
i
==
0
||
(
hviews
[
i
]
!=
hviews
[
i
-
1
])),
...
...
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