Autosyncing with Wine HEAD

svn path=/trunk/; revision=26077
This commit is contained in:
The Wine Synchronizer 2007-03-14 12:55:03 +00:00
parent 428fdc04d7
commit 8392d2f122
6 changed files with 79 additions and 58 deletions

View file

@ -191,7 +191,7 @@ HRESULT WINAPI CloseINFEngine(HINF hInf)
*/ */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
TRACE("(%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved); TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
if (fdwReason == DLL_PROCESS_ATTACH) if (fdwReason == DLL_PROCESS_ATTACH)
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
@ -220,7 +220,7 @@ BOOL WINAPI IsNTAdmin(DWORD reserved, LPDWORD pReserved)
HANDLE hToken; HANDLE hToken;
PSID pSid; PSID pSid;
TRACE("(%ld, %p)\n", reserved, pReserved); TRACE("(%d, %p)\n", reserved, pReserved);
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
return FALSE; return FALSE;
@ -302,7 +302,7 @@ DWORD WINAPI NeedRebootInit(VOID)
*/ */
BOOL WINAPI NeedReboot(DWORD dwRebootCheck) BOOL WINAPI NeedReboot(DWORD dwRebootCheck)
{ {
FIXME("(%ld): stub\n", dwRebootCheck); FIXME("(%d): stub\n", dwRebootCheck);
return FALSE; return FALSE;
} }
@ -317,7 +317,7 @@ HRESULT WINAPI OpenINFEngineA(LPCSTR pszInfFilename, LPCSTR pszInstallSection,
UNICODE_STRING filenameW, installW; UNICODE_STRING filenameW, installW;
HRESULT res; HRESULT res;
TRACE("(%s, %s, %ld, %p, %p)\n", debugstr_a(pszInfFilename), TRACE("(%s, %s, %d, %p, %p)\n", debugstr_a(pszInfFilename),
debugstr_a(pszInstallSection), dwFlags, phInf, pvReserved); debugstr_a(pszInstallSection), dwFlags, phInf, pvReserved);
if (!pszInfFilename || !phInf) if (!pszInfFilename || !phInf)
@ -355,7 +355,7 @@ HRESULT WINAPI OpenINFEngineA(LPCSTR pszInfFilename, LPCSTR pszInstallSection,
HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection, HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection,
DWORD dwFlags, HINF *phInf, PVOID pvReserved) DWORD dwFlags, HINF *phInf, PVOID pvReserved)
{ {
TRACE("(%s, %s, %ld, %p, %p)\n", debugstr_w(pszInfFilename), TRACE("(%s, %s, %d, %p, %p)\n", debugstr_w(pszInfFilename),
debugstr_w(pszInstallSection), dwFlags, phInf, pvReserved); debugstr_w(pszInstallSection), dwFlags, phInf, pvReserved);
if (!pszInfFilename || !phInf) if (!pszInfFilename || !phInf)
@ -376,12 +376,12 @@ HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection,
* See RebootCheckOnInstallW. * See RebootCheckOnInstallW.
*/ */
HRESULT WINAPI RebootCheckOnInstallA(HWND hWnd, LPCSTR pszINF, HRESULT WINAPI RebootCheckOnInstallA(HWND hWnd, LPCSTR pszINF,
LPSTR pszSec, DWORD dwReserved) LPCSTR pszSec, DWORD dwReserved)
{ {
UNICODE_STRING infW, secW; UNICODE_STRING infW, secW;
HRESULT res; HRESULT res;
TRACE("(%p, %s, %s, %ld)\n", hWnd, debugstr_a(pszINF), TRACE("(%p, %s, %s, %d)\n", hWnd, debugstr_a(pszINF),
debugstr_a(pszSec), dwReserved); debugstr_a(pszSec), dwReserved);
if (!pszINF || !pszSec) if (!pszINF || !pszSec)
@ -422,9 +422,9 @@ HRESULT WINAPI RebootCheckOnInstallA(HWND hWnd, LPCSTR pszINF,
* Unimplemented. * Unimplemented.
*/ */
HRESULT WINAPI RebootCheckOnInstallW(HWND hWnd, LPCWSTR pszINF, HRESULT WINAPI RebootCheckOnInstallW(HWND hWnd, LPCWSTR pszINF,
LPWSTR pszSec, DWORD dwReserved) LPCWSTR pszSec, DWORD dwReserved)
{ {
FIXME("(%p, %s, %s, %ld): stub\n", hWnd, debugstr_w(pszINF), FIXME("(%p, %s, %s, %d): stub\n", hWnd, debugstr_w(pszINF),
debugstr_w(pszSec), dwReserved); debugstr_w(pszSec), dwReserved);
return E_FAIL; return E_FAIL;
@ -635,7 +635,7 @@ HRESULT WINAPI TranslateInfStringA(LPCSTR pszInfFilename, LPCSTR pszInstallSecti
HRESULT res; HRESULT res;
DWORD len = 0; DWORD len = 0;
TRACE("(%s, %s, %s, %s, %p, %ld, %p, %p)\n", TRACE("(%s, %s, %s, %s, %p, %d, %p, %p)\n",
debugstr_a(pszInfFilename), debugstr_a(pszInstallSection), debugstr_a(pszInfFilename), debugstr_a(pszInstallSection),
debugstr_a(pszTranslateSection), debugstr_a(pszTranslateKey), debugstr_a(pszTranslateSection), debugstr_a(pszTranslateKey),
pszBuffer, dwBufferSize,pdwRequiredSize, pvReserved); pszBuffer, dwBufferSize,pdwRequiredSize, pvReserved);
@ -710,8 +710,9 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved) DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved)
{ {
HINF hInf; HINF hInf;
HRESULT hret = S_OK;
TRACE("(%s, %s, %s, %s, %p, %ld, %p, %p)\n", TRACE("(%s, %s, %s, %s, %p, %d, %p, %p)\n",
debugstr_w(pszInfFilename), debugstr_w(pszInstallSection), debugstr_w(pszInfFilename), debugstr_w(pszInstallSection),
debugstr_w(pszTranslateSection), debugstr_w(pszTranslateKey), debugstr_w(pszTranslateSection), debugstr_w(pszTranslateKey),
pszBuffer, dwBufferSize,pdwRequiredSize, pvReserved); pszBuffer, dwBufferSize,pdwRequiredSize, pvReserved);
@ -730,13 +731,13 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
pszBuffer, dwBufferSize, pdwRequiredSize)) pszBuffer, dwBufferSize, pdwRequiredSize))
{ {
if (dwBufferSize < *pdwRequiredSize) if (dwBufferSize < *pdwRequiredSize)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); hret = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
else
return SPAPI_E_LINE_NOT_FOUND; hret = SPAPI_E_LINE_NOT_FOUND;
} }
SetupCloseInfFile(hInf); SetupCloseInfFile(hInf);
return S_OK; return hret;
} }
/*********************************************************************** /***********************************************************************
@ -754,7 +755,7 @@ HRESULT WINAPI TranslateInfStringExA(HINF hInf, LPCSTR pszInfFilename,
HRESULT res; HRESULT res;
DWORD len = 0; DWORD len = 0;
TRACE("(%p, %s, %s, %s, %s, %ld, %p, %p)\n", hInf, debugstr_a(pszInfFilename), TRACE("(%p, %s, %s, %s, %s, %d, %p, %p)\n", hInf, debugstr_a(pszInfFilename),
debugstr_a(pszTranslateSection), debugstr_a(pszTranslateKey), debugstr_a(pszTranslateSection), debugstr_a(pszTranslateKey),
debugstr_a(pszBuffer), dwBufferSize, pdwRequiredSize, pvReserved); debugstr_a(pszBuffer), dwBufferSize, pdwRequiredSize, pvReserved);
@ -834,7 +835,7 @@ HRESULT WINAPI TranslateInfStringExW(HINF hInf, LPCWSTR pszInfFilename,
LPWSTR pszBuffer, DWORD dwBufferSize, LPWSTR pszBuffer, DWORD dwBufferSize,
PDWORD pdwRequiredSize, PVOID pvReserved) PDWORD pdwRequiredSize, PVOID pvReserved)
{ {
TRACE("(%p, %s, %s, %s, %s, %ld, %p, %p)\n", hInf, debugstr_w(pszInfFilename), TRACE("(%p, %s, %s, %s, %s, %d, %p, %p)\n", hInf, debugstr_w(pszInfFilename),
debugstr_w(pszTranslateSection), debugstr_w(pszTranslateKey), debugstr_w(pszTranslateSection), debugstr_w(pszTranslateKey),
debugstr_w(pszBuffer), dwBufferSize, pdwRequiredSize, pvReserved); debugstr_w(pszBuffer), dwBufferSize, pdwRequiredSize, pvReserved);

View file

@ -26,6 +26,5 @@ LPWSTR get_parameter(LPWSTR *params, WCHAR separator);
void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir); void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir);
HRESULT launch_exe(LPCWSTR cmd, LPCWSTR dir, HANDLE *phEXE); HRESULT launch_exe(LPCWSTR cmd, LPCWSTR dir, HANDLE *phEXE);
HRESULT do_ocx_reg(HMODULE hocx, BOOL do_reg);
#endif /* __ADVPACK_PRIVATE_H */ #endif /* __ADVPACK_PRIVATE_H */

View file

@ -59,10 +59,11 @@ HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir,
LPCSTR lpcszBaseName, DWORD dwFlags) LPCSTR lpcszBaseName, DWORD dwFlags)
{ {
UNICODE_STRING backupdir, basename; UNICODE_STRING backupdir, basename;
LPWSTR filelist, backup; LPWSTR filelist;
LPCWSTR backup;
HRESULT res; HRESULT res;
TRACE("(%s, %s, %s, %ld)\n", debugstr_a(lpcszFileList), TRACE("(%s, %s, %s, %d)\n", debugstr_a(lpcszFileList),
debugstr_a(lpcszBackupDir), debugstr_a(lpcszBaseName), dwFlags); debugstr_a(lpcszBackupDir), debugstr_a(lpcszBaseName), dwFlags);
if (lpcszFileList) if (lpcszFileList)
@ -126,7 +127,7 @@ HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir,
static const WCHAR ini[] = {'.','i','n','i',0}; static const WCHAR ini[] = {'.','i','n','i',0};
static const WCHAR backup[] = {'b','a','c','k','u','p',0}; static const WCHAR backup[] = {'b','a','c','k','u','p',0};
TRACE("(%s, %s, %s, %ld)\n", debugstr_w(lpcszFileList), TRACE("(%s, %s, %s, %d)\n", debugstr_w(lpcszFileList),
debugstr_w(lpcszBackupDir), debugstr_w(lpcszBaseName), dwFlags); debugstr_w(lpcszBackupDir), debugstr_w(lpcszBaseName), dwFlags);
if (!lpcszFileList || !*lpcszFileList) if (!lpcszFileList || !*lpcszFileList)
@ -164,14 +165,14 @@ HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir,
/* FIXME: this is only for the local case, X:\ */ /* FIXME: this is only for the local case, X:\ */
#define ROOT_LENGTH 3 #define ROOT_LENGTH 3
UINT CALLBACK pQuietQueueCallback(PVOID Context, UINT Notification, static UINT CALLBACK pQuietQueueCallback(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2) UINT_PTR Param1, UINT_PTR Param2)
{ {
return 1; return 1;
} }
UINT CALLBACK pQueueCallback(PVOID Context, UINT Notification, static UINT CALLBACK pQueueCallback(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2) UINT_PTR Param1, UINT_PTR Param2)
{ {
/* only be verbose for error notifications */ /* only be verbose for error notifications */
if (!Notification || if (!Notification ||
@ -199,7 +200,7 @@ HRESULT WINAPI AdvInstallFileA(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourc
UNICODE_STRING destdir, destfile; UNICODE_STRING destdir, destfile;
HRESULT res; HRESULT res;
TRACE("(%p, %s, %s, %s, %s, %ld, %ld)\n", hwnd, debugstr_a(lpszSourceDir), TRACE("(%p, %s, %s, %s, %s, %d, %d)\n", hwnd, debugstr_a(lpszSourceDir),
debugstr_a(lpszSourceFile), debugstr_a(lpszDestDir), debugstr_a(lpszSourceFile), debugstr_a(lpszDestDir),
debugstr_a(lpszDestFile), dwFlags, dwReserved); debugstr_a(lpszDestFile), dwFlags, dwReserved);
@ -256,7 +257,7 @@ HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSou
HSPFILEQ fileQueue; HSPFILEQ fileQueue;
PVOID pContext; PVOID pContext;
TRACE("(%p, %s, %s, %s, %s, %ld, %ld)\n", hwnd, debugstr_w(lpszSourceDir), TRACE("(%p, %s, %s, %s, %s, %d, %d)\n", hwnd, debugstr_w(lpszSourceDir),
debugstr_w(lpszSourceFile), debugstr_w(lpszDestDir), debugstr_w(lpszSourceFile), debugstr_w(lpszDestDir),
debugstr_w(lpszDestFile), dwFlags, dwReserved); debugstr_w(lpszDestFile), dwFlags, dwReserved);
@ -403,7 +404,7 @@ HRESULT WINAPI DelNodeA(LPCSTR pszFileOrDirName, DWORD dwFlags)
UNICODE_STRING fileordirname; UNICODE_STRING fileordirname;
HRESULT res; HRESULT res;
TRACE("(%s, %ld)\n", debugstr_a(pszFileOrDirName), dwFlags); TRACE("(%s, %d)\n", debugstr_a(pszFileOrDirName), dwFlags);
RtlCreateUnicodeStringFromAsciiz(&fileordirname, pszFileOrDirName); RtlCreateUnicodeStringFromAsciiz(&fileordirname, pszFileOrDirName);
@ -437,7 +438,7 @@ HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags)
WCHAR fname[MAX_PATH]; WCHAR fname[MAX_PATH];
HRESULT ret = E_FAIL; HRESULT ret = E_FAIL;
TRACE("(%s, %ld)\n", debugstr_w(pszFileOrDirName), dwFlags); TRACE("(%s, %d)\n", debugstr_w(pszFileOrDirName), dwFlags);
if (dwFlags) if (dwFlags)
FIXME("Flags ignored!\n"); FIXME("Flags ignored!\n");
@ -572,7 +573,10 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
/* empty list */ /* empty list */
if (!lstrlenA(szConvertedList)) if (!lstrlenA(szConvertedList))
{
HeapFree(GetProcessHeap(), 0, szConvertedList);
return NULL; return NULL;
}
*dwNumFiles = 1; *dwNumFiles = 1;
@ -599,7 +603,7 @@ static void free_file_node(struct ExtractFileList *pNode)
} }
/* determines whether szFile is in the NULL-separated szFileList */ /* determines whether szFile is in the NULL-separated szFileList */
static BOOL file_in_list(LPSTR szFile, LPSTR szFileList) static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
{ {
DWORD dwLen = lstrlenA(szFile); DWORD dwLen = lstrlenA(szFile);
DWORD dwTestLen; DWORD dwTestLen;
@ -623,7 +627,7 @@ static BOOL file_in_list(LPSTR szFile, LPSTR szFileList)
/* removes nodes from the linked list that aren't specified in szFileList /* removes nodes from the linked list that aren't specified in szFileList
* returns the number of files that are in both the linked list and szFileList * returns the number of files that are in both the linked list and szFileList
*/ */
static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPSTR szFileList) static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR szFileList)
{ {
DWORD dwNumFound = 0; DWORD dwNumFound = 0;
struct ExtractFileList *pNode; struct ExtractFileList *pNode;
@ -698,7 +702,7 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
DWORD dwFilesFound = 0; DWORD dwFilesFound = 0;
LPSTR szConvertedList = NULL; LPSTR szConvertedList = NULL;
TRACE("(%s, %s, %ld, %s, %p, %ld)\n", debugstr_a(CabName), debugstr_a(ExpandDir), TRACE("(%s, %s, %d, %s, %p, %d)\n", debugstr_a(CabName), debugstr_a(ExpandDir),
Flags, debugstr_a(FileList), LReserved, Reserved); Flags, debugstr_a(FileList), LReserved, Reserved);
if (!CabName || !ExpandDir) if (!CabName || !ExpandDir)
@ -743,6 +747,19 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
extractDest.flags |= EXTRACT_EXTRACTFILES; extractDest.flags |= EXTRACT_EXTRACTFILES;
res = pExtract(&extractDest, CabName); res = pExtract(&extractDest, CabName);
if (extractDest.filelist)
{
struct ExtractFileList* curr = extractDest.filelist;
struct ExtractFileList* next;
while (curr)
{
next = curr->next;
free_file_node(curr);
curr = next;
}
}
done: done:
FreeLibrary(hCabinet); FreeLibrary(hCabinet);
HeapFree(GetProcessHeap(), 0, szConvertedList); HeapFree(GetProcessHeap(), 0, szConvertedList);
@ -797,7 +814,7 @@ HRESULT WINAPI FileSaveRestoreA(HWND hDlg, LPSTR pszFileList, LPSTR pszDir,
UNICODE_STRING filelist, dir, basename; UNICODE_STRING filelist, dir, basename;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %s, %s, %ld)\n", hDlg, debugstr_a(pszFileList), TRACE("(%p, %s, %s, %s, %d)\n", hDlg, debugstr_a(pszFileList),
debugstr_a(pszDir), debugstr_a(pszBaseName), dwFlags); debugstr_a(pszDir), debugstr_a(pszBaseName), dwFlags);
RtlCreateUnicodeStringFromAsciiz(&filelist, pszFileList); RtlCreateUnicodeStringFromAsciiz(&filelist, pszFileList);
@ -839,7 +856,7 @@ HRESULT WINAPI FileSaveRestoreA(HWND hDlg, LPSTR pszFileList, LPSTR pszDir,
HRESULT WINAPI FileSaveRestoreW(HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir, HRESULT WINAPI FileSaveRestoreW(HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir,
LPWSTR pszBaseName, DWORD dwFlags) LPWSTR pszBaseName, DWORD dwFlags)
{ {
FIXME("(%p, %s, %s, %s, %ld) stub\n", hDlg, debugstr_w(pszFileList), FIXME("(%p, %s, %s, %s, %d) stub\n", hDlg, debugstr_w(pszFileList),
debugstr_w(pszDir), debugstr_w(pszBaseName), dwFlags); debugstr_w(pszDir), debugstr_w(pszBaseName), dwFlags);
return E_FAIL; return E_FAIL;
@ -858,7 +875,7 @@ HRESULT WINAPI FileSaveRestoreOnINFA(HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF,
UNICODE_STRING backupdir, backupfile; UNICODE_STRING backupdir, backupfile;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %s, %s, %s, %s, %ld)\n", hWnd, debugstr_a(pszTitle), TRACE("(%p, %s, %s, %s, %s, %s, %d)\n", hWnd, debugstr_a(pszTitle),
debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszBackupDir), debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszBackupDir),
debugstr_a(pszBaseBackupFile), dwFlags); debugstr_a(pszBaseBackupFile), dwFlags);
@ -907,7 +924,7 @@ HRESULT WINAPI FileSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF
LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszSection, LPCWSTR pszBackupDir,
LPCWSTR pszBaseBackupFile, DWORD dwFlags) LPCWSTR pszBaseBackupFile, DWORD dwFlags)
{ {
FIXME("(%p, %s, %s, %s, %s, %s, %ld): stub\n", hWnd, debugstr_w(pszTitle), FIXME("(%p, %s, %s, %s, %s, %s, %d): stub\n", hWnd, debugstr_w(pszTitle),
debugstr_w(pszINF), debugstr_w(pszSection), debugstr_w(pszBackupDir), debugstr_w(pszINF), debugstr_w(pszSection), debugstr_w(pszBackupDir),
debugstr_w(pszBaseBackupFile), dwFlags); debugstr_w(pszBaseBackupFile), dwFlags);

View file

@ -214,14 +214,14 @@ LPWSTR get_parameter(LPWSTR *params, WCHAR separator)
return token; return token;
} }
static BOOL is_full_path(LPWSTR path) static BOOL is_full_path(LPCWSTR path)
{ {
const int MIN_PATH_LEN = 3; const int MIN_PATH_LEN = 3;
if (!path || lstrlenW(path) < MIN_PATH_LEN) if (!path || lstrlenW(path) < MIN_PATH_LEN)
return FALSE; return FALSE;
if (path[1] == ':' || (path[0] == '\\' && path[1] == '\\')) if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -229,7 +229,7 @@ static BOOL is_full_path(LPWSTR path)
/* retrieves the contents of a field, dynamically growing the buffer if necessary */ /* retrieves the contents of a field, dynamically growing the buffer if necessary */
static WCHAR *get_field_string(INFCONTEXT *context, DWORD index, WCHAR *buffer, static WCHAR *get_field_string(INFCONTEXT *context, DWORD index, WCHAR *buffer,
WCHAR *static_buffer, DWORD *size) const WCHAR *static_buffer, DWORD *size)
{ {
DWORD required; DWORD required;
@ -425,8 +425,8 @@ static HRESULT get_working_dir(ADVInfo *info, LPCWSTR inf_filename, LPCWSTR work
} }
/* loads the INF file and performs checks on it */ /* loads the INF file and performs checks on it */
HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec, static HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec,
LPCWSTR working_dir, DWORD flags, ADVInfo *info) LPCWSTR working_dir, DWORD flags, ADVInfo *info)
{ {
DWORD len; DWORD len;
HRESULT hr; HRESULT hr;
@ -500,7 +500,7 @@ HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec,
} }
/* release the install instance information */ /* release the install instance information */
void install_release(ADVInfo *info) static void install_release(ADVInfo *info)
{ {
if (info->hinf && info->hinf != INVALID_HANDLE_VALUE) if (info->hinf && info->hinf != INVALID_HANDLE_VALUE)
SetupCloseInfFile(info->hinf); SetupCloseInfFile(info->hinf);
@ -833,7 +833,7 @@ HRESULT WINAPI LaunchINFSectionExW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, I
LPWSTR cmdline_copy, cmdline_ptr; LPWSTR cmdline_copy, cmdline_ptr;
LPWSTR flags, ptr; LPWSTR flags, ptr;
CABINFOW cabinfo; CABINFOW cabinfo;
HRESULT hr = S_OK; HRESULT hr;
TRACE("(%p, %p, %s, %d)\n", hWnd, hInst, debugstr_w(cmdline), show); TRACE("(%p, %p, %s, %d)\n", hWnd, hInst, debugstr_w(cmdline), show);
@ -853,22 +853,26 @@ HRESULT WINAPI LaunchINFSectionExW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, I
if (flags) if (flags)
cabinfo.dwFlags = atolW(flags); cabinfo.dwFlags = atolW(flags);
if (!is_full_path(cabinfo.pszCab) && !is_full_path(cabinfo.pszInf))
{
HeapFree(GetProcessHeap(), 0, cmdline_copy);
return E_INVALIDARG;
}
/* get the source path from the cab filename */ /* get the source path from the cab filename */
if (cabinfo.pszCab && *cabinfo.pszCab) if (cabinfo.pszCab && *cabinfo.pszCab)
{ {
if (!is_full_path(cabinfo.pszCab)) if (!is_full_path(cabinfo.pszCab))
goto done; lstrcpyW(cabinfo.szSrcPath, cabinfo.pszInf);
else
lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab);
lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab);
ptr = strrchrW(cabinfo.szSrcPath, '\\'); ptr = strrchrW(cabinfo.szSrcPath, '\\');
*(++ptr) = '\0'; *(++ptr) = '\0';
} }
hr = ExecuteCabW(hWnd, &cabinfo, NULL); hr = ExecuteCabW(hWnd, &cabinfo, NULL);
done:
HeapFree(GetProcessHeap(), 0, cmdline_copy); HeapFree(GetProcessHeap(), 0, cmdline_copy);
return SUCCEEDED(hr) ? ADV_SUCCESS : ADV_FAILURE; return SUCCEEDED(hr) ? ADV_SUCCESS : ADV_FAILURE;
} }
@ -919,7 +923,7 @@ HRESULT WINAPI RunSetupCommandA(HWND hWnd, LPCSTR szCmdName,
UNICODE_STRING dir, title; UNICODE_STRING dir, title;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %s, %s, %s, %p, %ld, %p)\n", TRACE("(%p, %s, %s, %s, %s, %p, %d, %p)\n",
hWnd, debugstr_a(szCmdName), debugstr_a(szInfSection), hWnd, debugstr_a(szCmdName), debugstr_a(szInfSection),
debugstr_a(szDir), debugstr_a(lpszTitle), debugstr_a(szDir), debugstr_a(lpszTitle),
phEXE, dwFlags, pvReserved); phEXE, dwFlags, pvReserved);
@ -976,7 +980,7 @@ HRESULT WINAPI RunSetupCommandW(HWND hWnd, LPCWSTR szCmdName,
ADVInfo info; ADVInfo info;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %s, %s, %s, %p, %ld, %p)\n", TRACE("(%p, %s, %s, %s, %s, %p, %d, %p)\n",
hWnd, debugstr_w(szCmdName), debugstr_w(szInfSection), hWnd, debugstr_w(szCmdName), debugstr_w(szInfSection),
debugstr_w(szDir), debugstr_w(lpszTitle), debugstr_w(szDir), debugstr_w(lpszTitle),
phEXE, dwFlags, pvReserved); phEXE, dwFlags, pvReserved);

View file

@ -98,7 +98,7 @@ error:
return FALSE; return FALSE;
} }
static void strentry_atow(STRENTRYA *aentry, STRENTRYW *wentry) static void strentry_atow(const STRENTRYA *aentry, STRENTRYW *wentry)
{ {
DWORD name_len, val_len; DWORD name_len, val_len;
@ -171,7 +171,7 @@ HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTa
return hr; return hr;
} }
static HRESULT write_predefined_strings(HMODULE hm, LPWSTR ini_path) static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path)
{ {
WCHAR mod_path[MAX_PATH + 2]; WCHAR mod_path[MAX_PATH + 2];
WCHAR sys_mod_path[MAX_PATH + 2]; WCHAR sys_mod_path[MAX_PATH + 2];
@ -324,7 +324,7 @@ HRESULT WINAPI RegSaveRestoreA(HWND hWnd, LPCSTR pszTitleString, HKEY hkBackupKe
UNICODE_STRING title, root, subkey, value; UNICODE_STRING title, root, subkey, value;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %p, %s, %s, %s, %ld)\n", hWnd, debugstr_a(pszTitleString), TRACE("(%p, %s, %p, %s, %s, %s, %d)\n", hWnd, debugstr_a(pszTitleString),
hkBackupKey, debugstr_a(pcszRootKey), debugstr_a(pcszSubKey), hkBackupKey, debugstr_a(pcszRootKey), debugstr_a(pcszSubKey),
debugstr_a(pcszValueName), dwFlags); debugstr_a(pcszValueName), dwFlags);
@ -369,7 +369,7 @@ HRESULT WINAPI RegSaveRestoreW(HWND hWnd, LPCWSTR pszTitleString, HKEY hkBackupK
LPCWSTR pcszRootKey, LPCWSTR pcszSubKey, LPCWSTR pcszRootKey, LPCWSTR pcszSubKey,
LPCWSTR pcszValueName, DWORD dwFlags) LPCWSTR pcszValueName, DWORD dwFlags)
{ {
FIXME("(%p, %s, %p, %s, %s, %s, %ld): stub\n", hWnd, debugstr_w(pszTitleString), FIXME("(%p, %s, %p, %s, %s, %s, %d): stub\n", hWnd, debugstr_w(pszTitleString),
hkBackupKey, debugstr_w(pcszRootKey), debugstr_w(pcszSubKey), hkBackupKey, debugstr_w(pcszRootKey), debugstr_w(pcszSubKey),
debugstr_w(pcszValueName), dwFlags); debugstr_w(pcszValueName), dwFlags);
@ -388,7 +388,7 @@ HRESULT WINAPI RegSaveRestoreOnINFA(HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF,
UNICODE_STRING title, inf, section; UNICODE_STRING title, inf, section;
HRESULT hr; HRESULT hr;
TRACE("(%p, %s, %s, %s, %p, %p, %ld)\n", hWnd, debugstr_a(pszTitle), TRACE("(%p, %s, %s, %s, %p, %p, %d)\n", hWnd, debugstr_a(pszTitle),
debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszINF), debugstr_a(pszSection),
hHKLMBackKey, hHKCUBackKey, dwFlags); hHKLMBackKey, hHKCUBackKey, dwFlags);
@ -431,7 +431,7 @@ HRESULT WINAPI RegSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF,
LPCWSTR pszSection, HKEY hHKLMBackKey, LPCWSTR pszSection, HKEY hHKLMBackKey,
HKEY hHKCUBackKey, DWORD dwFlags) HKEY hHKCUBackKey, DWORD dwFlags)
{ {
FIXME("(%p, %s, %s, %s, %p, %p, %ld): stub\n", hWnd, debugstr_w(pszTitle), FIXME("(%p, %s, %s, %s, %p, %p, %d): stub\n", hWnd, debugstr_w(pszTitle),
debugstr_w(pszINF), debugstr_w(pszSection), debugstr_w(pszINF), debugstr_w(pszSection),
hHKLMBackKey, hHKCUBackKey, dwFlags); hHKLMBackKey, hHKCUBackKey, dwFlags);

View file

@ -223,8 +223,8 @@ HRESULT WINAPI OpenINFEngineA(LPCSTR pszInfFilename, LPCSTR pszInstallSection,
HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection, HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection,
DWORD dwFlags, HINF *phInf, PVOID pvReserved); DWORD dwFlags, HINF *phInf, PVOID pvReserved);
#define OpenINFEngine WINELIB_NAME_AW(OpenINFEngine) #define OpenINFEngine WINELIB_NAME_AW(OpenINFEngine)
HRESULT WINAPI RebootCheckOnInstallA(HWND hWnd, LPCSTR pszINF, LPSTR pszSec, DWORD dwReserved); HRESULT WINAPI RebootCheckOnInstallA(HWND hWnd, LPCSTR pszINF, LPCSTR pszSec, DWORD dwReserved);
HRESULT WINAPI RebootCheckOnInstallW(HWND hWnd, LPCWSTR pszINF, LPWSTR pszSec, DWORD dwReserved); HRESULT WINAPI RebootCheckOnInstallW(HWND hWnd, LPCWSTR pszINF, LPCWSTR pszSec, DWORD dwReserved);
#define RebootCheckOnInstall WINELIB_NAME_AW(RebootCheckOnInstall) #define RebootCheckOnInstall WINELIB_NAME_AW(RebootCheckOnInstall)
HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
HRESULT WINAPI RegInstallW(HMODULE hm, LPCWSTR pszSection, const STRTABLEW* pstTable); HRESULT WINAPI RegInstallW(HMODULE hm, LPCWSTR pszSection, const STRTABLEW* pstTable);