MSI: MsiSetComponentState[AW] implementation
Johan Dahlin
jdahlin at async.com.br
Wed Aug 24 07:26:48 CDT 2005
Adds implementation and prototypes in msiquery.h
On top of my last patch, against current CVS.
Johan
-------------- next part --------------
Index: include/msiquery.h
===================================================================
RCS file: /home/wine/wine/include/msiquery.h,v
retrieving revision 1.15
diff -u -B -p -r1.15 msiquery.h
--- include/msiquery.h 24 Aug 2005 10:57:49 -0000 1.15
+++ include/msiquery.h 24 Aug 2005 12:24:43 -0000
@@ -175,6 +175,9 @@ UINT WINAPI MsiDatabaseCommit(MSIHANDLE)
UINT WINAPI MsiGetFeatureStateA(MSIHANDLE,LPSTR,INSTALLSTATE*,INSTALLSTATE*);
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*);
#define MsiGetFeatureState WINELIB_NAME_AW(MsiGetFeatureState)
+UINT WINAPI MsiSetComponentStateA(MSIHANDLE,LPCSTR,INSTALLSTATE);
+UINT WINAPI MsiSetComponentStateW(MSIHANDLE,LPCWSTR,INSTALLSTATE);
+#define MsiSetComponentState WINELIB_NAME_AW(MsiSetComponentState)
UINT WINAPI MsiGetComponentStateA(MSIHANDLE,LPSTR,INSTALLSTATE*,INSTALLSTATE*);
UINT WINAPI MsiGetComponentStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*);
#define MsiGetComponentState WINELIB_NAME_AW(MsiGetComponentState)
Index: dlls/msi/install.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/install.c,v
retrieving revision 1.7
diff -u -B -p -r1.7 install.c
--- dlls/msi/install.c 24 Aug 2005 10:56:27 -0000 1.7
+++ dlls/msi/install.c 24 Aug 2005 12:24:43 -0000
@@ -529,7 +528,31 @@ piAction);
UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent,
INSTALLSTATE iState)
{
- FIXME("STUB (szComponent=%s,iState=%i)\n",debugstr_a(szComponent),iState);
+ LPWSTR szwComponent = NULL;
+ UINT rc;
+
+ szwComponent = strdupAtoW(szComponent);
+
+ rc = MsiSetComponentStateW(hInstall, szwComponent, iState);
+
+ HeapFree(GetProcessHeap(), 0, szwComponent);
+
+ return rc;
+}
+
+UINT MSI_SetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent,
+ INSTALLSTATE iState)
+{
+ MSICOMPONENT *comp;
+
+ TRACE("%p %s %d\n", package, debugstr_w(szComponent), iState);
+
+ comp = get_loaded_component(package, szComponent);
+ if (!comp)
+ return ERROR_UNKNOWN_COMPONENT;
+
+ comp->Installed = iState;
+
return ERROR_SUCCESS;
}
@@ -580,7 +603,17 @@ UINT MSI_GetComponentStateW(MSIPACKAGE *
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent,
INSTALLSTATE iState)
{
- FIXME("STUB (szComponent=%s,iState=%i)\n",debugstr_w(szComponent),iState);
+ MSIPACKAGE* package;
+ UINT ret;
+
+ package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
+ if (!package) {
+ return ERROR_INVALID_HANDLE;
+ }
+
+ ret = MSI_SetComponentStateW(package, szComponent, iState);
+ msiobj_release(&package->hdr);
+
return ERROR_SUCCESS;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdahlin.vcf
Type: text/x-vcard
Size: 414 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050824/05d2a88c/jdahlin.vcf
More information about the wine-patches
mailing list