Implemented MsiSetComponentState*.

This commit is contained in:
Johan Dahlin 2005-08-24 18:13:09 +00:00 committed by Alexandre Julliard
parent 34247aff40
commit b5c02815d0
2 changed files with 36 additions and 4 deletions

View File

@ -529,8 +529,14 @@ piAction);
UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent,
INSTALLSTATE iState) INSTALLSTATE iState)
{ {
FIXME("STUB (szComponent=%s,iState=%i)\n",debugstr_a(szComponent),iState); UINT rc;
return ERROR_SUCCESS; LPWSTR szwComponent = strdupAtoW(szComponent);
rc = MsiSetComponentStateW(hInstall, szwComponent, iState);
HeapFree(GetProcessHeap(), 0, szwComponent);
return rc;
} }
/*********************************************************************** /***********************************************************************
@ -551,6 +557,22 @@ UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPSTR szComponent,
return rc; return rc;
} }
static 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;
}
UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPWSTR szComponent, UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPWSTR szComponent,
INSTALLSTATE *piInstalled, INSTALLSTATE *piAction) INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
{ {
@ -580,8 +602,15 @@ UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPWSTR szComponent,
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent,
INSTALLSTATE iState) INSTALLSTATE iState)
{ {
FIXME("STUB (szComponent=%s,iState=%i)\n",debugstr_w(szComponent),iState); MSIPACKAGE* package;
return ERROR_SUCCESS; UINT ret;
package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
if (!package)
return ERROR_INVALID_HANDLE;
ret = MSI_SetComponentStateW(package, szComponent, iState);
msiobj_release(&package->hdr);
return ret;
} }
/*********************************************************************** /***********************************************************************

View File

@ -175,6 +175,9 @@ UINT WINAPI MsiDatabaseCommit(MSIHANDLE);
UINT WINAPI MsiGetFeatureStateA(MSIHANDLE,LPSTR,INSTALLSTATE*,INSTALLSTATE*); UINT WINAPI MsiGetFeatureStateA(MSIHANDLE,LPSTR,INSTALLSTATE*,INSTALLSTATE*);
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*); UINT WINAPI MsiGetFeatureStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*);
#define MsiGetFeatureState WINELIB_NAME_AW(MsiGetFeatureState) #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 MsiGetComponentStateA(MSIHANDLE,LPSTR,INSTALLSTATE*,INSTALLSTATE*);
UINT WINAPI MsiGetComponentStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*); UINT WINAPI MsiGetComponentStateW(MSIHANDLE,LPWSTR,INSTALLSTATE*,INSTALLSTATE*);
#define MsiGetComponentState WINELIB_NAME_AW(MsiGetComponentState) #define MsiGetComponentState WINELIB_NAME_AW(MsiGetComponentState)