Added (some) file operations in shlfileop.c

David Grant dave at reach.net
Thu Feb 22 13:28:15 CST 2001


Hi,

This implements partial support for FO_COPY and FO_DELETE..  It copies
and delete things.. it doesn't create the perdy GUI+status bar thingy..
but it makes some installers happier (ie. Roller Coaster Tycoon :)

Thanks,

   dave.


Changelog

    * /dlls/shell32/shlfileop.c:
    David Grant <dave at reach.net>
    Added (partial) support for FO_COPY and FO_DELETE.

-- 
David Grant
University of Waterloo
Computer Engineering
dave at reach.net
-------------- next part --------------
Index: dlls/shell32/shlfileop.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlfileop.c,v
retrieving revision 1.10
diff -u -r1.10 shlfileop.c
--- dlls/shell32/shlfileop.c	2001/02/21 04:01:20	1.10
+++ dlls/shell32/shlfileop.c	2001/02/22 19:17:52
@@ -4,6 +4,8 @@
 #include <string.h>
 #include "debugtools.h"
 #include "shellapi.h"
+#include "heap.h"
+#include "shlwapi.h"
 
 #include "shlobj.h"
 #include "shresdef.h"
@@ -154,7 +156,50 @@
  */
 DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp)   
 {
-	FIXME("(%p):stub.\n", lpFileOp);
+	LPSTR pFrom = (LPSTR)lpFileOp->pFrom;
+	LPSTR pTo = (LPSTR)lpFileOp->pTo;
+	LPSTR pTempTo;
+	
+	switch(lpFileOp->wFunc) {
+	case FO_COPY:
+		TRACE("File Copy:\n");
+		while(1) {
+			if(!pFrom[0]) break;	
+			if(!pTo[0]) break;
+			TRACE("   From='%s' To='%s'\n", pFrom, pTo);
+
+			pTempTo = HEAP_strdupA(GetProcessHeap(), 0, pTo);
+			PathRemoveFileSpecA(pTempTo);
+			TRACE("   Creating Directory '%s'\n", pTempTo);
+			SHCreateDirectory(NULL,pTempTo);
+			HeapFree(GetProcessHeap(), 0, pTempTo);
+
+			CopyFileA(pFrom, pTo, FALSE);
+
+			pFrom += strlen(pFrom) + 1;
+			pTo += strlen(pTo) + 1;
+		}
+		TRACE("Setting AnyOpsAborted=FALSE\n");
+		lpFileOp->fAnyOperationsAborted=FALSE;
+		return 0;
+
+	case FO_DELETE:
+		TRACE("File Delete:\n");
+		while(1) {
+			if(!pFrom[0]) break;	
+			TRACE("   File='%s'\n", pFrom);
+			DeleteFileA(pFrom);
+			pFrom += strlen(pFrom) + 1;
+		}
+		TRACE("Setting AnyOpsAborted=FALSE\n");
+		lpFileOp->fAnyOperationsAborted=FALSE;
+		return 0;
+		
+
+	default:
+		FIXME("Unhandled shell file operation %d\n", lpFileOp->wFunc);
+	}
+
 	return 1;
 }
 


More information about the wine-patches mailing list