MsiSourceListClearMediaDiskA function (msi.h)
The MsiSourceListClearMediaDisk function provides the ability to remove an existing registered disk under the media source for a product or patch in a specific context.
Syntax
UINT MsiSourceListClearMediaDiskA(
[in] LPCSTR szProductCodeOrPatchCode,
[in, optional] LPCSTR szUserSid,
[in] MSIINSTALLCONTEXT dwContext,
[in] DWORD dwOptions,
[in] DWORD dwDiskId
);
Parameters
[in] szProductCodeOrPatchCode
The ProductCode or patch GUID of the product or patch. Use a null-terminated string. If the string is longer than 39 characters, the function fails and returns ERROR_INVALID_PARAMETER. This parameter cannot be NULL.
[in, optional] szUserSid
This parameter can be a string SID that specifies the user account that contains the product or patch. The SID is not validated or resolved. An incorrect SID can return ERROR_UNKNOWN_PRODUCT or ERROR_UNKNOWN_PATCH.
[in] dwContext
This parameter specifies the context of the product or patch instance. This parameter can contain one of the following values.
[in] dwOptions
The dwOptions value specifies the meaning of szProductCodeOrPatchCode.
Flag | Meaning |
---|---|
|
szProductCodeOrPatchCode is a product code GUID. |
|
szProductCodeOrPatchCode is a patch code GUID. |
[in] dwDiskId
This parameter provides the ID of the disk being removed.
Return value
The MsiSourceListClearMediaDisk function returns the following values.
Value | Meaning |
---|---|
|
The user does not have the ability to read the specified media source or the specified product or patch. This does not indicate whether a media source, product or patch was found. |
|
The configuration data is corrupt. |
|
The Windows Installer service could not be accessed. |
|
An invalid parameter was passed to the function. |
|
The value was successfully removed or not found. |
|
The patch was not found. |
|
The product was not found. |
|
Unexpected internal failure. |
Remarks
Administrators can modify the installation of a product or patch instance that exists under the machine context or under their own per-user context (managed or unmanaged.) They can modify the installation of a product or patch instance that exists under any user's per-user-managed context. Administrators cannot modify another user's installation of a product or patch instance that exists under that other user's per-user-unmanaged context.
Non-administrators cannot modify the installation of a product or patch instance that exists under another user's per-user context (managed or unmanaged.) They can modify the installation of a product or patch instance that exists under their own per-user-unmanaged context. They can modify the installation of a product or patch instance under the machine context or their own per-user-managed context only if they are enabled to browse for a product or patch source. Users can be enabled to browse for sources by setting policy. For more information, see the DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies.
Note
The msi.h header defines MsiSourceListClearMediaDisk as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer 3.0 or later on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |