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
41c788f5
Commit
41c788f5
authored
Sep 28, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't create MSI handles unless we have to pass one through the API.
parent
b3563dac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
81 deletions
+52
-81
custom.c
dlls/msi/custom.c
+4
-4
handle.c
dlls/msi/handle.c
+0
-19
msi.c
dlls/msi/msi.c
+48
-57
msipriv.h
dlls/msi/msipriv.h
+0
-1
No files found.
dlls/msi/custom.c
View file @
41c788f5
...
...
@@ -430,11 +430,11 @@ static DWORD WINAPI ACTION_CallDllFunction(thread_struct *stuff)
MSIPACKAGE
*
package
=
stuff
->
package
;
TRACE
(
"Calling function %s
\n
"
,
proc
);
hPackage
=
msiobj_find
handle
(
&
package
->
hdr
);
if
(
hPackage
)
hPackage
=
alloc_msi
handle
(
&
package
->
hdr
);
if
(
hPackage
)
{
rc
=
fn
(
hPackage
);
msiobj_release
(
&
package
->
hdr
);
rc
=
fn
(
hPackage
);
MsiCloseHandle
(
hPackage
);
}
else
ERR
(
"Handle for object %p not found
\n
"
,
package
);
...
...
dlls/msi/handle.c
View file @
41c788f5
...
...
@@ -109,25 +109,6 @@ out:
return
(
void
*
)
ret
;
}
MSIHANDLE
msiobj_findhandle
(
MSIOBJECTHDR
*
hdr
)
{
MSIHANDLE
ret
=
0
;
UINT
i
;
TRACE
(
"%p
\n
"
,
hdr
);
EnterCriticalSection
(
&
MSI_handle_cs
);
for
(
i
=
0
;
(
i
<
MSIMAXHANDLES
)
&&
!
ret
;
i
++
)
if
(
msihandletable
[
i
].
obj
==
hdr
)
ret
=
i
+
1
;
LeaveCriticalSection
(
&
MSI_handle_cs
);
TRACE
(
"%p -> %ld
\n
"
,
hdr
,
ret
);
msiobj_addref
(
hdr
);
return
ret
;
}
void
*
alloc_msiobject
(
UINT
type
,
UINT
size
,
msihandledestructor
destroy
)
{
MSIOBJECTHDR
*
info
;
...
...
dlls/msi/msi.c
View file @
41c788f5
...
...
@@ -81,14 +81,14 @@ UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
return
r
;
}
UINT
WINAPI
MsiOpenProductW
(
LPCWSTR
szProduct
,
MSIHANDLE
*
phProduct
)
static
UINT
MSI_OpenProductW
(
LPCWSTR
szProduct
,
MSIPACKAGE
**
ppackage
)
{
LPWSTR
path
=
NULL
;
UINT
r
;
HKEY
hKeyProduct
=
NULL
;
DWORD
count
,
type
;
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
szProduct
),
phProduct
);
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
szProduct
),
ppackage
);
r
=
MSIREG_OpenUninstallKey
(
szProduct
,
&
hKeyProduct
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
@@ -120,7 +120,7 @@ UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
goto
end
;
}
r
=
M
siOpenPackageW
(
path
,
phProduct
);
r
=
M
SI_OpenPackageW
(
path
,
ppackage
);
end:
msi_free
(
path
);
...
...
@@ -130,6 +130,20 @@ end:
return
r
;
}
UINT
WINAPI
MsiOpenProductW
(
LPCWSTR
szProduct
,
MSIHANDLE
*
phProduct
)
{
MSIPACKAGE
*
package
=
NULL
;
UINT
r
;
r
=
MSI_OpenProductW
(
szProduct
,
&
package
);
if
(
r
==
ERROR_SUCCESS
)
{
*
phProduct
=
alloc_msihandle
(
&
package
->
hdr
);
msiobj_release
(
&
package
->
hdr
);
}
return
r
;
}
UINT
WINAPI
MsiAdvertiseProductA
(
LPCSTR
szPackagePath
,
LPCSTR
szScriptfilePath
,
LPCSTR
szTransforms
,
LANGID
lgidLanguage
)
{
...
...
@@ -198,21 +212,15 @@ UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
{
MSIPACKAGE
*
package
=
NULL
;
UINT
r
;
MSIHANDLE
handle
;
FIXME
(
"%s %s
\n
"
,
debugstr_w
(
szPackagePath
),
debugstr_w
(
szCommandLine
));
r
=
MSI_OpenPackageW
(
szPackagePath
,
&
package
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
handle
=
alloc_msihandle
(
&
package
->
hdr
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
szPackagePath
,
szCommandLine
,
szPackagePath
);
MsiCloseHandle
(
handle
);
msiobj_release
(
&
package
->
hdr
);
if
(
r
==
ERROR_SUCCESS
)
{
r
=
ACTION_DoTopLevelINSTALL
(
package
,
szPackagePath
,
szCommandLine
,
szPackagePath
);
msiobj_release
(
&
package
->
hdr
);
}
return
r
;
}
...
...
@@ -248,9 +256,8 @@ UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage,
UINT
WINAPI
MsiConfigureProductExW
(
LPCWSTR
szProduct
,
int
iInstallLevel
,
INSTALLSTATE
eInstallState
,
LPCWSTR
szCommandLine
)
{
MSIHANDLE
handle
=
-
1
;
MSIPACKAGE
*
package
;
UINT
rc
;
MSIPACKAGE
*
package
=
NULL
;
UINT
r
;
DWORD
sz
;
WCHAR
sourcepath
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
...
...
@@ -277,7 +284,7 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
MsiSourceListGetInfoW
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_PACKAGENAMEW
,
filename
,
&
sz
);
strcatW
(
sourcepath
,
filename
);
l
strcatW
(
sourcepath
,
filename
);
/*
* ok 1, we need to find the msi file for this product.
...
...
@@ -286,42 +293,37 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
* 4, cleanupany runonce entry.
*/
rc
=
MsiOpenProductW
(
szProduct
,
&
handle
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
package
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
{
rc
=
ERROR_INVALID_HANDLE
;
goto
end
;
}
r
=
MSI_OpenProductW
(
szProduct
,
&
package
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
sz
=
lstrlenW
(
szInstalled
);
sz
=
lstrlenW
(
szInstalled
)
+
1
;
if
(
szCommandLine
)
sz
+=
lstrlenW
(
szCommandLine
);
commandline
=
msi_alloc
(
sz
*
sizeof
(
WCHAR
));
if
(
!
commandline
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
end
;
}
commandline
[
0
]
=
0
;
if
(
szCommandLine
)
lstrcpyW
(
commandline
,
szCommandLine
);
else
commandline
[
0
]
=
0
;
if
(
MsiQueryProductStateW
(
szProduct
)
!=
INSTALLSTATE_UNKNOWN
)
lstrcatW
(
commandline
,
szInstalled
);
rc
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
msiobj_release
(
&
package
->
hdr
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
msi_free
(
commandline
);
end:
if
(
handle
!=
-
1
)
MsiCloseHandle
(
handle
);
msiobj_release
(
&
package
->
hdr
);
return
r
c
;
return
r
;
}
UINT
WINAPI
MsiConfigureProductExA
(
LPCSTR
szProduct
,
int
iInstallLevel
,
...
...
@@ -1753,9 +1755,8 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
UINT
WINAPI
MsiReinstallFeatureW
(
LPCWSTR
szProduct
,
LPCWSTR
szFeature
,
DWORD
dwReinstallMode
)
{
MSIHANDLE
handle
=
-
1
;
MSIPACKAGE
*
package
;
UINT
rc
;
MSIPACKAGE
*
package
=
NULL
;
UINT
r
;
DWORD
sz
;
WCHAR
sourcepath
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
...
...
@@ -1805,20 +1806,13 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature,
strcatW
(
sourcepath
,
filename
);
if
(
!
(
dwReinstallMode
&
REINSTALLMODE_PACKAGE
)
)
r
c
=
MsiOpenProductW
(
szProduct
,
&
handle
);
if
(
dwReinstallMode
&
REINSTALLMODE_PACKAGE
)
r
=
MSI_OpenPackageW
(
sourcepath
,
&
package
);
else
rc
=
MsiOpenPackageW
(
sourcepath
,
&
handle
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
r
=
MSI_OpenProductW
(
szProduct
,
&
package
);
package
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
{
rc
=
ERROR_INVALID_HANDLE
;
goto
end
;
}
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
MSI_SetPropertyW
(
package
,
REINSTALLMODE
,
reinstallmode
);
...
...
@@ -1831,16 +1825,13 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature,
sprintfW
(
commandline
,
fmt
,
szFeature
);
lstrcatW
(
commandline
,
szInstalled
);
r
c
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
msiobj_release
(
&
package
->
hdr
);
msi_free
(
commandline
);
end:
if
(
handle
!=
-
1
)
MsiCloseHandle
(
handle
);
return
r
c
;
return
r
;
}
UINT
WINAPI
MsiReinstallFeatureA
(
LPCSTR
szProduct
,
LPCSTR
szFeature
,
...
...
dlls/msi/msipriv.h
View file @
41c788f5
...
...
@@ -267,7 +267,6 @@ extern void msiobj_addref(MSIOBJECTHDR *);
extern
int
msiobj_release
(
MSIOBJECTHDR
*
);
extern
void
msiobj_lock
(
MSIOBJECTHDR
*
);
extern
void
msiobj_unlock
(
MSIOBJECTHDR
*
);
extern
MSIHANDLE
msiobj_findhandle
(
MSIOBJECTHDR
*
hdr
);
extern
void
free_cached_tables
(
MSIDATABASE
*
db
);
extern
string_table
*
load_string_table
(
IStorage
*
stg
);
...
...
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