Module: wine Branch: refs/heads/master Commit: 017d1b0b564fafc6a15d2b7f42284a7d1dc45a9e URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=017d1b0b564fafc6a15d2b7f...
Author: James Hawkins truiken@gmail.com Date: Thu Mar 30 12:26:59 2006 -0600
advpack: Forward ExecuteCabA to its Unicode counterpart.
---
dlls/advpack/advpack.spec | 2 +- dlls/advpack/install.c | 48 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec index 252b779..2d3731c 100644 --- a/dlls/advpack/advpack.spec +++ b/dlls/advpack/advpack.spec @@ -14,7 +14,7 @@ @ stdcall -private DllMain(long long ptr) @ stdcall DoInfInstall(ptr) @ stdcall ExecuteCabA(ptr ptr ptr) -# stdcall ExecuteCabW(ptr ptr ptr) +@ stdcall ExecuteCabW(ptr ptr ptr) @ stdcall ExecuteCab(ptr ptr ptr) ExecuteCabA @ stdcall ExtractFilesA(str str long ptr ptr long) # stdcall ExtractFilesW(wstr wstr long ptr ptr long) diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c index 042f761..80ed36e 100644 --- a/dlls/advpack/install.c +++ b/dlls/advpack/install.c @@ -27,6 +27,7 @@ #include "winreg.h" #include "winver.h" #include "winternl.h" +#include "winnls.h" #include "setupapi.h" #include "advpub.h" #include "wine/debug.h" @@ -86,6 +87,51 @@ HRESULT WINAPI DoInfInstall(const SETUPC
/*********************************************************************** * ExecuteCabA (ADVPACK.@) + * + * See ExecuteCabW. + */ +HRESULT WINAPI ExecuteCabA(HWND hwnd, CABINFOA* pCab, LPVOID pReserved) +{ + UNICODE_STRING cab, inf, section; + CABINFOW cabinfo; + HRESULT hr; + + TRACE("(%p, %p, %p)\n", hwnd, pCab, pReserved); + + if (!pCab) + return E_INVALIDARG; + + if (pCab->pszCab) + { + RtlCreateUnicodeStringFromAsciiz(&cab, pCab->pszCab); + cabinfo.pszCab = cab.Buffer; + } + else + cabinfo.pszCab = NULL; + + RtlCreateUnicodeStringFromAsciiz(&inf, pCab->pszInf); + RtlCreateUnicodeStringFromAsciiz(§ion, pCab->pszSection); + + MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath, + sizeof(cabinfo.szSrcPath) / sizeof(WCHAR)); + + cabinfo.pszInf = inf.Buffer; + cabinfo.pszSection = section.Buffer; + cabinfo.dwFlags = pCab->dwFlags; + + hr = ExecuteCabW(hwnd, &cabinfo, pReserved); + + if (pCab->pszCab) + RtlFreeUnicodeString(&cab); + + RtlFreeUnicodeString(&inf); + RtlFreeUnicodeString(§ion); + + return hr; +} + +/*********************************************************************** + * ExecuteCabW (ADVPACK.@) * * Installs the INF file extracted from a specified cabinet file. * @@ -101,7 +147,7 @@ HRESULT WINAPI DoInfInstall(const SETUPC * BUGS * Unimplemented */ -HRESULT WINAPI ExecuteCabA( HWND hwnd, CABINFOA* pCab, LPVOID pReserved ) +HRESULT WINAPI ExecuteCabW(HWND hwnd, CABINFOW* pCab, LPVOID pReserved) { FIXME("(%p %p %p): stub\n", hwnd, pCab, pReserved); return E_FAIL;