Commit 1fced5cc authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Add tests for MsiSourceListAddMediaDisk.

parent 8b540d26
......@@ -266,7 +266,7 @@
270 stub MsiEnumPatchesExW
271 stub MsiSourceListEnumMediaDisksA
272 stub MsiSourceListEnumMediaDisksW
273 stub MsiSourceListAddMediaDiskA
273 stdcall MsiSourceListAddMediaDiskA(str str long long long str str)
274 stdcall MsiSourceListAddMediaDiskW(wstr wstr long long long wstr wstr)
275 stub MsiSourceListClearMediaDiskA
276 stub MsiSourceListClearMediaDiskW
......
......@@ -939,7 +939,36 @@ done:
}
/******************************************************************
* MsiSourceListAddMediaDisk(MSI.@)
* MsiSourceListAddMediaDiskA (MSI.@)
*/
UINT WINAPI MsiSourceListAddMediaDiskA(LPCSTR szProduct, LPCSTR szUserSid,
MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId,
LPCSTR szVolumeLabel, LPCSTR szDiskPrompt)
{
UINT r;
LPWSTR product = NULL;
LPWSTR usersid = NULL;
LPWSTR volume = NULL;
LPWSTR prompt = NULL;
if (szProduct) product = strdupAtoW(szProduct);
if (szUserSid) usersid = strdupAtoW(szUserSid);
if (szVolumeLabel) volume = strdupAtoW(szVolumeLabel);
if (szDiskPrompt) prompt = strdupAtoW(szDiskPrompt);
r = MsiSourceListAddMediaDiskW(product, usersid, dwContext, dwOptions,
dwDiskId, volume, prompt);
msi_free(product);
msi_free(usersid);
msi_free(volume);
msi_free(prompt);
return r;
}
/******************************************************************
* MsiSourceListAddMediaDiskW (MSI.@)
*/
UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId,
......@@ -975,7 +1004,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
if (dwContext == MSIINSTALLCONTEXT_USERUNMANAGED)
FIXME("Unknown context MSIINSTALLCONTEXT_USERUNMANAGED\n");
rc = OpenSourceKey(szProduct, &sourcekey, MSICODE_PRODUCT, dwContext, TRUE);
rc = OpenSourceKey(szProduct, &sourcekey, MSICODE_PRODUCT, dwContext, FALSE);
if (rc != ERROR_SUCCESS)
return ERROR_UNKNOWN_PRODUCT;
......
......@@ -2139,7 +2139,7 @@ static void test_Installer_InstallProduct(void)
/* Package name */
memset(szString, 0, sizeof(szString));
hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PACKAGENAMEW, szString);
todo_wine ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, szMsifile);
/* Product name */
......@@ -2248,11 +2248,6 @@ static void test_Installer_InstallProduct(void)
res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products\\05FA3C1F65B896A40AC00077F34EF203");
todo_wine ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_SUCCESS, got %d\n", res);
res = delete_registry_key(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\"
"CurrentVersion\\Installer\\Managed\\S-1-5-4\\"
"Installer\\Products\\05FA3C1F65B896A40AC00077F34EF203");
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
/* Delete installation files we installed */
delete_test_files();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment