Merge from Wine: - Add traces at the start of functions - (reported by Matthew Davison) Preserve the spaces before an opening quote in the middle of a token. - Matthew Davison mjd77@cam.ac.uk Stub out the error dialog functions. Modify the default callbacks to call these for Delete and Rename errors. Modify the default callbacks to ignore file missing errors when deleting files. - Stefan Huehner stefan@huehner.org Fix some more -Wmissing-declarations warnings. - Mike McCormack mike@codeweavers.com gcc 4.0 -Wpointer-sign fixes (Reg* functions). - Detlef Riekenberg wine.dev@web.de SetupSetFileQueueAlternatePlatform{AW} implemented as stub. Modified: trunk/reactos/include/wine/setupapi.h Modified: trunk/reactos/lib/setupapi/misc.c Modified: trunk/reactos/lib/setupapi/parser.c Modified: trunk/reactos/lib/setupapi/queue.c Modified: trunk/reactos/lib/setupapi/setupapi.spec Modified: trunk/reactos/lib/setupapi/setupx_main.c Modified: trunk/reactos/lib/setupapi/virtcopy.c _____
Modified: trunk/reactos/include/wine/setupapi.h --- trunk/reactos/include/wine/setupapi.h 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/include/wine/setupapi.h 2005-08-01 07:46:06 UTC (rev 16931) @@ -668,6 +668,14 @@
#define SPDRP_MAXIMUM_PROPERTY 0x00000023
+/* Return values for SetupCopyError/SetupDeleteError/SetupRenameError */ +#define DPROMPT_SUCCESS 0x00000000 +#define DPROMPT_CANCEL 0x00000001 +#define DPROMPT_SKIPFILE 0x00000002 +#define DPROMPT_BUFFERTOOSMALL 0x00000003 +#define DPROMPT_OUTOFMEMORY 0x00000004 + + /* Flags for StringTableAddString and StringTableLookUpString */ #define ST_CASE_SENSITIVE_COMPARE 0x00000001
@@ -702,9 +710,15 @@ BOOL WINAPI SetupCommitFileQueueA( HWND, HSPFILEQ, PSP_FILE_CALLBACK_A, PVOID ); BOOL WINAPI SetupCommitFileQueueW( HWND, HSPFILEQ, PSP_FILE_CALLBACK_W, PVOID ); #define SetupCommitFileQueue WINELIB_NAME_AW(SetupCommitFileQueue) +UINT WINAPI SetupCopyErrorA( HWND, PCSTR, PCSTR, PCSTR, PCSTR, PCSTR, UINT, DWORD, PSTR, DWORD, PDWORD ); +UINT WINAPI SetupCopyErrorW( HWND, PCWSTR, PCWSTR, PCWSTR, PCWSTR, PCWSTR, UINT, DWORD, PWSTR, DWORD, PDWORD ); +#define SetupCopyError WINELIB_NAME_AW(SetupCopyError) UINT WINAPI SetupDefaultQueueCallbackA( PVOID, UINT, UINT_PTR, UINT_PTR ); UINT WINAPI SetupDefaultQueueCallbackW( PVOID, UINT, UINT_PTR, UINT_PTR ); #define SetupDefaultQueueCallback WINELIB_NAME_AW(SetupDefaultQueueCallback) +UINT WINAPI SetupDeleteErrorA( HWND, PCSTR, PCSTR, UINT, DWORD ); +UINT WINAPI SetupDeleteErrorW( HWND, PCWSTR, PCWSTR, UINT, DWORD ); +#define SetupDeleteError WINELIB_NAME_AW(SetupDeleteError) BOOL WINAPI SetupDiBuildClassInfoList(DWORD, LPGUID, DWORD, PDWORD); BOOL WINAPI SetupDiBuildClassInfoListExA(DWORD, LPGUID, DWORD, PDWORD, PCSTR, PVOID); BOOL WINAPI SetupDiBuildClassInfoListExW(DWORD, LPGUID, DWORD, PDWORD, PCWSTR, PVOID); @@ -831,6 +845,9 @@ BOOL WINAPI SetupQueueRenameSectionA( HSPFILEQ, HINF, HINF, PCSTR ); BOOL WINAPI SetupQueueRenameSectionW( HSPFILEQ, HINF, HINF, PCWSTR ); #define SetupQueueRenameSection WINELIB_NAME_AW(SetupQueueRenameSection) +UINT WINAPI SetupRenameErrorA( HWND, PCSTR, PCSTR, PCSTR, UINT, DWORD ); +UINT WINAPI SetupRenameErrorW( HWND, PCWSTR, PCWSTR, PCWSTR, UINT, DWORD ); +#define SetupRenameError WINELIB_NAME_AW(SetupRenameError) BOOL WINAPI SetupScanFileQueueA( HSPFILEQ, DWORD, HWND, PSP_FILE_CALLBACK_A, PVOID, PDWORD ); BOOL WINAPI SetupScanFileQueueW( HSPFILEQ, DWORD, HWND, PSP_FILE_CALLBACK_W, PVOID, PDWORD ); #define SetupScanFileQueue WINELIB_NAME_AW(SetupScanFileQueue) _____
Modified: trunk/reactos/lib/setupapi/misc.c --- trunk/reactos/lib/setupapi/misc.c 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/misc.c 2005-08-01 07:46:06 UTC (rev 16931) @@ -25,7 +25,6 @@
#include "wingdi.h" #include "winuser.h" #include "winreg.h" -#include "winver.h" #include "setupapi.h"
#include "wine/unicode.h" @@ -162,7 +161,7 @@ { LONG lError;
- TRACE("%lx %s %p %p %p\n", + TRACE("%p %s %p %p %p\n", hKey, debugstr_w(lpValueName), lpData, lpType, lpcbData);
/* Get required buffer size */ @@ -284,7 +283,7 @@ LPWSTR lpUnicodeStr; int nLength;
- TRACE("%s %lu\n", debugstr_a(lpMultiByteStr), uCodePage); + TRACE("%s %d\n", debugstr_a(lpMultiByteStr), uCodePage);
nLength = MultiByteToWideChar(uCodePage, 0, lpMultiByteStr, -1, NULL, 0); @@ -327,7 +326,7 @@ LPSTR lpMultiByteStr; int nLength;
- TRACE("%s %lu\n", debugstr_w(lpUnicodeStr), uCodePage); + TRACE("%s %d\n", debugstr_w(lpUnicodeStr), uCodePage);
nLength = WideCharToMultiByte(uCodePage, 0, lpUnicodeStr, -1, NULL, 0, NULL, NULL); @@ -667,7 +666,7 @@ */ BOOL WINAPI UnmapAndCloseFile(HANDLE hFile, HANDLE hMapping, LPVOID lpBuffer) { - TRACE("%x %x %p\n", + TRACE("%p %p %p\n", hFile, hMapping, lpBuffer);
if (!UnmapViewOfFile(lpBuffer)) _____
Modified: trunk/reactos/lib/setupapi/parser.c --- trunk/reactos/lib/setupapi/parser.c 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/parser.c 2005-08-01 07:46:06 UTC (rev 16931) @@ -647,7 +647,7 @@
set_state( parser, COMMENT ); return p + 1; case '"': - push_token( parser, token_end ); + push_token( parser, p ); parser->start = p + 1; push_state( parser, KEY_NAME ); set_state( parser, QUOTES ); @@ -699,7 +699,7 @@ set_state( parser, LEADING_SPACES ); return p + 1; case '"': - push_token( parser, token_end ); + push_token( parser, p ); parser->start = p + 1; push_state( parser, VALUE_NAME ); set_state( parser, QUOTES ); _____
Modified: trunk/reactos/lib/setupapi/queue.c --- trunk/reactos/lib/setupapi/queue.c 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/queue.c 2005-08-01 07:46:06 UTC (rev 16931) @@ -979,8 +979,8 @@
if ((GetFileAttributesW(target) != INVALID_FILE_ATTRIBUTES) && (GetFileAttributesW(source) != INVALID_FILE_ATTRIBUTES)) { - VersionSizeSource = GetFileVersionInfoSizeW((LPWSTR)source,&zero); - VersionSizeTarget = GetFileVersionInfoSizeW((LPWSTR)target,&zero); + VersionSizeSource = GetFileVersionInfoSizeW(source,&zero); + VersionSizeTarget = GetFileVersionInfoSizeW(target,&zero); }
TRACE("SizeTarget %li ... SizeSource %li\n",VersionSizeTarget, @@ -999,9 +999,9 @@ VersionSource = HeapAlloc(GetProcessHeap(),0,VersionSizeSource); VersionTarget = HeapAlloc(GetProcessHeap(),0,VersionSizeTarget);
- ret = GetFileVersionInfoW((LPWSTR)source,0,VersionSizeSource,VersionSource); + ret = GetFileVersionInfoW(source,0,VersionSizeSource,VersionSource); if (ret) - ret = GetFileVersionInfoW((LPWSTR)target, 0, VersionSizeTarget, + ret = GetFileVersionInfoW(target, 0, VersionSizeTarget, VersionTarget);
if (ret) @@ -1268,6 +1268,26 @@
/*********************************************************************** + * SetupSetFileQueueAlternatePlatformA (SETUPAPI.@) + */ +BOOL WINAPI SetupSetFileQueueAlternatePlatformA(HSPFILEQ handle, PSP_ALTPLATFORM_INFO platform, PCSTR catalogfile) +{ + FIXME("(%p, %p, %s) stub!\n", handle, platform, debugstr_a(catalogfile)); + return FALSE; +} + + +/********************************************************************** * + * SetupSetFileQueueAlternatePlatformW (SETUPAPI.@) + */ +BOOL WINAPI SetupSetFileQueueAlternatePlatformW(HSPFILEQ handle, PSP_ALTPLATFORM_INFO platform, PCWSTR catalogfile) +{ + FIXME("(%p, %p, %s) stub!\n", handle, platform, debugstr_w(catalogfile)); + return FALSE; +} + + +/********************************************************************** * * SetupInitDefaultQueueCallback (SETUPAPI.@) */ PVOID WINAPI SetupInitDefaultQueueCallback( HWND owner ) @@ -1310,6 +1330,7 @@ UINT_PTR param1, UINT_PTR param2 ) { FILEPATHS_A *paths = (FILEPATHS_A *)param1; + struct default_callback_context *ctx = (struct default_callback_context *)context;
switch(notification) { @@ -1332,7 +1353,9 @@ TRACE( "end delete %s\n", debugstr_a(paths->Target) ); return 0; case SPFILENOTIFY_DELETEERROR: - ERR( "delete error %d %s\n", paths->Win32Error, debugstr_a(paths->Target) ); + /*Windows Ignores attempts to delete files / folders which do not exist*/ + if ((paths->Win32Error != ERROR_FILE_NOT_FOUND) && (paths->Win32Error != ERROR_PATH_NOT_FOUND)) + SetupDeleteErrorA(ctx->owner, NULL, paths->Target, paths->Win32Error, 0); return FILEOP_SKIP; case SPFILENOTIFY_STARTRENAME: TRACE( "start rename %s -> %s\n", debugstr_a(paths->Source), debugstr_a(paths->Target) ); @@ -1341,8 +1364,7 @@ TRACE( "end rename %s -> %s\n", debugstr_a(paths->Source), debugstr_a(paths->Target) ); return 0; case SPFILENOTIFY_RENAMEERROR: - ERR( "rename error %d %s -> %s\n", paths->Win32Error, - debugstr_a(paths->Source), debugstr_a(paths->Target) ); + SetupRenameErrorA(ctx->owner, NULL, paths->Source, paths->Target, paths->Win32Error, 0); return FILEOP_SKIP; case SPFILENOTIFY_STARTCOPY: TRACE( "start copy %s -> %s\n", debugstr_a(paths->Source), debugstr_a(paths->Target) ); @@ -1372,6 +1394,7 @@ UINT_PTR param1, UINT_PTR param2 ) { FILEPATHS_W *paths = (FILEPATHS_W *)param1; + struct default_callback_context *ctx = (struct default_callback_context *)context;
switch(notification) { @@ -1394,10 +1417,12 @@ TRACE( "end delete %s\n", debugstr_w(paths->Target) ); return 0; case SPFILENOTIFY_DELETEERROR: - ERR( "delete error %d %s\n", paths->Win32Error, debugstr_w(paths->Target) ); + /*Windows Ignores attempts to delete files / folders which do not exist*/ + if ((paths->Win32Error != ERROR_FILE_NOT_FOUND) && (paths->Win32Error != ERROR_PATH_NOT_FOUND)) + SetupDeleteErrorW(ctx->owner, NULL, paths->Target, paths->Win32Error, 0); return FILEOP_SKIP; case SPFILENOTIFY_STARTRENAME: - TRACE( "start rename %s -> %s\n", debugstr_w(paths->Source), debugstr_w(paths->Target) ); + SetupRenameErrorW(ctx->owner, NULL, paths->Source, paths->Target, paths->Win32Error, 0); return FILEOP_DOIT; case SPFILENOTIFY_ENDRENAME: TRACE( "end rename %s -> %s\n", debugstr_w(paths->Source), debugstr_w(paths->Target) ); @@ -1425,3 +1450,80 @@ } return 0; } + +/********************************************************************** * + * SetupDeleteErrorA (SETUPAPI.@) + */ + +UINT WINAPI SetupDeleteErrorA( HWND parent, PCSTR dialogTitle, PCSTR file, + UINT w32error, DWORD style) +{ + FIXME( "stub: (Error Number %d when attempting to delete %s)\n", + w32error, debugstr_a(file) ); + return DPROMPT_SKIPFILE; +} + +/********************************************************************** * + * SetupDeleteErrorW (SETUPAPI.@) + */ + +UINT WINAPI SetupDeleteErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR file, + UINT w32error, DWORD style) +{ + FIXME( "stub: (Error Number %d when attempting to delete %s)\n", + w32error, debugstr_w(file) ); + return DPROMPT_SKIPFILE; +} + +/********************************************************************** * + * SetupRenameErrorA (SETUPAPI.@) + */ + +UINT WINAPI SetupRenameErrorA( HWND parent, PCSTR dialogTitle, PCSTR source, + PCSTR target, UINT w32error, DWORD style) +{ + FIXME( "stub: (Error Number %d when attempting to rename %s to %s)\n", + w32error, debugstr_a(source), debugstr_a(target)); + return DPROMPT_SKIPFILE; +} + +/********************************************************************** * + * SetupRenameErrorW (SETUPAPI.@) + */ + +UINT WINAPI SetupRenameErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR source, + PCWSTR target, UINT w32error, DWORD style) +{ + FIXME( "stub: (Error Number %d when attempting to rename %s to %s)\n", + w32error, debugstr_w(source), debugstr_w(target)); + return DPROMPT_SKIPFILE; +} + + +/********************************************************************** * + * SetupCopyErrorA (SETUPAPI.@) + */ + +UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname, + PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath, + UINT w32error, DWORD style, PSTR pathbuffer, + DWORD buffersize, PDWORD requiredsize) +{ + FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n", + w32error, debugstr_a(sourcefile), debugstr_a(sourcepath) ,debugstr_a(targetpath)); + return DPROMPT_SKIPFILE; +} + +/********************************************************************** * + * SetupCopyErrorW (SETUPAPI.@) + */ + +UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname, + PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath, + UINT w32error, DWORD style, PWSTR pathbuffer, + DWORD buffersize, PDWORD requiredsize) +{ + FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n", + w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath)); + return DPROMPT_SKIPFILE; +} _____
Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-08-01 07:46:06 UTC (rev 16931) @@ -248,11 +248,10 @@
@ stdcall SetupCloseFileQueue(ptr) @ stdcall SetupCloseInfFile(long) @ stub SetupCloseLog -@ stdcall SetupCommitFileQueue(long long ptr ptr) SetupCommitFileQueueW @ stdcall SetupCommitFileQueueA(long long ptr ptr) @ stdcall SetupCommitFileQueueW(long long ptr ptr) -@ stub SetupCopyErrorA -@ stub SetupCopyErrorW +@ stdcall SetupCopyErrorA(long str str str str str long long str long ptr) +@ stdcall SetupCopyErrorW(long wstr wstr wstr wstr wstr long long wstr long ptr) @ stdcall SetupCopyOEMInfA(str str long long ptr long ptr ptr) @ stdcall SetupCopyOEMInfW(wstr wstr long long ptr long ptr ptr) @ stdcall SetupCreateDiskSpaceListA(ptr long long) @@ -262,8 +261,8 @@ @ stub SetupDefaultQueueCallback @ stdcall SetupDefaultQueueCallbackA(ptr long long long) @ stdcall SetupDefaultQueueCallbackW(ptr long long long) -@ stub SetupDeleteErrorA -@ stub SetupDeleteErrorW +@ stdcall SetupDeleteErrorA(long str str long long) +@ stdcall SetupDeleteErrorW(long wstr wstr long long) @ stdcall SetupDestroyDiskSpaceList(long) @ stub SetupDiAskForOEMDisk @ stdcall SetupDiBuildClassInfoList(long ptr long ptr) @@ -494,8 +493,8 @@ @ stub SetupRemoveInstallSectionFromDiskSpaceListW @ stub SetupRemoveSectionFromDiskSpaceListA @ stub SetupRemoveSectionFromDiskSpaceListW -@ stub SetupRenameErrorA -@ stub SetupRenameErrorW +@ stdcall SetupRenameErrorA(long str str str long long) +@ stdcall SetupRenameErrorW(long wstr wstr wstr long long) @ stub SetupScanFileQueue @ stdcall SetupScanFileQueueA(long long long ptr ptr ptr) @ stdcall SetupScanFileQueueW(long long long ptr ptr ptr) @@ -503,8 +502,8 @@ @ stub SetupSetDirectoryIdExA @ stub SetupSetDirectoryIdExW @ stdcall SetupSetDirectoryIdW(long long wstr) -@ stub SetupFileQueueAlternatePlatformA -@ stub SetupFileQueueAlternatePlatformW +@ stdcall SetupSetFileQueueAlternatePlatformA(ptr ptr str) +@ stdcall SetupSetFileQueueAlternatePlatformW(ptr ptr wstr) @ stdcall SetupSetFileQueueFlags(long long long) @ stub SetupSetPlatformPathOverrideA @ stub SetupSetPlatformPathOverrideW _____
Modified: trunk/reactos/lib/setupapi/setupx_main.c --- trunk/reactos/lib/setupapi/setupx_main.c 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/setupx_main.c 2005-08-01 07:46:06 UTC (rev 16931) @@ -300,7 +300,7 @@
len = MAX_PATH; if ( (hKey) && (LDID_Data[n].RegValName) && (RegQueryValueExA(hKey, LDID_Data[n].RegValName, - NULL, &type, buffer, &len) == ERROR_SUCCESS) + NULL, &type, (LPBYTE)buffer, &len) == ERROR_SUCCESS) && (type == REG_SZ) ) { TRACE("found value '%s' for LDID %d\n", buffer, n); _____
Modified: trunk/reactos/lib/setupapi/virtcopy.c --- trunk/reactos/lib/setupapi/virtcopy.c 2005-08-01 00:06:18 UTC (rev 16930) +++ trunk/reactos/lib/setupapi/virtcopy.c 2005-08-01 07:46:06 UTC (rev 16931) @@ -218,7 +218,7 @@
static DWORD vn_num = 0; static DWORD vn_last = 0;
-RETERR16 VCP_VirtnodeCreate(LPVCPFILESPEC vfsSrc, LPVCPFILESPEC vfsDst, WORD fl, LPARAM lParam, LPEXPANDVTBL lpExpandVtbl) +static RETERR16 VCP_VirtnodeCreate(LPVCPFILESPEC vfsSrc, LPVCPFILESPEC vfsDst, WORD fl, LPARAM lParam, LPEXPANDVTBL lpExpandVtbl) { HANDLE heap; LPVIRTNODE lpvn; @@ -266,7 +266,8 @@ return OK; }
-BOOL VCP_VirtnodeDelete(LPVIRTNODE lpvnDel) +#if 0 +static BOOL VCP_VirtnodeDelete(LPVIRTNODE lpvnDel) { DWORD n; RETERR16 cbres; @@ -283,6 +284,7 @@ } return FALSE; } +#endif
/*********************************************************************** * VcpOpen (SETUPX.200) @@ -452,7 +454,7 @@ return buffer; }
-RETERR16 VCP_CheckPaths(void) +static RETERR16 VCP_CheckPaths(void) { DWORD n; LPVIRTNODE lpvn; @@ -470,7 +472,7 @@ return OK; }
-RETERR16 VCP_CopyFiles(void) +static RETERR16 VCP_CopyFiles(void) { char fn_src[MAX_PATH], fn_dst[MAX_PATH]; RETERR16 res = OK, cbres; @@ -559,7 +561,8 @@ return OK; }
-RETERR16 VCP_RenameFiles(void) +#if 0 +static RETERR16 VCP_RenameFiles(void) { char fn_src[MAX_PATH], fn_dst[MAX_PATH]; RETERR16 res = OK, cbres; @@ -582,6 +585,7 @@ cbres = VCP_Callback(&vcp_status, VCPM_VSTATRENAMEEND, 0, 0, VCP_MsgRef); return res; } +#endif
/*********************************************************************** * vcpDefCallbackProc (SETUPX.202) @@ -616,7 +620,7 @@ return retval; }
-BOOL VCP_UI_GetDialogTemplate(LPCVOID *template32) +static BOOL VCP_UI_GetDialogTemplate(LPCVOID *template32) { HRSRC hResInfo; HGLOBAL hDlgTmpl32; @@ -646,7 +650,7 @@ return 0; }
-void VCP_UI_RegisterProgressClass(void) +static void VCP_UI_RegisterProgressClass(void) { static BOOL registered = FALSE; WNDCLASSA wndClass; @@ -667,7 +671,7 @@ RegisterClassA (&wndClass); }
-RETERR16 VCP_UI_NodeCompare(LPVIRTNODE vn1, LPVIRTNODE vn2) +static RETERR16 VCP_UI_NodeCompare(LPVIRTNODE vn1, LPVIRTNODE vn2) { LPCSTR file1, file2; file1 = vsmGetStringRawName16(vn1->vfsSrc.vhstrFileName); @@ -675,7 +679,7 @@ return (RETERR16)strcmp(file1, file2); }
-RETERR16 VCP_UI_CopyStart(void) +static RETERR16 VCP_UI_CopyStart(void) { LPCVOID template32; char buf[256]; /* plenty */ @@ -715,7 +719,7 @@ if (RegSetValueExA(hKeyConflict, "Dirty", 0, REG_BINARY, (LPBYTE)&dirty, 1)) return VCPN_FAIL; len = 12; - if (!(RegQueryValueExA(hKeyConflict, "BackupDirectory", NULL, 0, BackupDir, &len))) + if (!(RegQueryValueExA(hKeyConflict, "BackupDirectory", NULL, 0, (LPBYTE)BackupDir, &len))) strcpy(BackupDir, "VCM");
/* create C:\WINDOWS[BackupDir] and set registry key to it */