Implement 'MakeSureDirectoryPathExists'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
I just wrote a little code implementing imagehlp/MakeSureDirectoryPathExists.
I don't have the specs available, so I *assume* this fn does what it says. 

in my code: I try to create the dir and don't fail if it already exists.

Changelog:
	* Implement MakeSureDirectoryPathExists in imagehlp/imagehlp_main.c

Interestingly, my 'diff' revealed 2 more  changes I have in my local 
repository. Please tell me if they should be applied.



Index: dlls/imagehlp/imagehlp_main.c
===================================================================
RCS file: /home/wine/wine/dlls/imagehlp/imagehlp_main.c,v
retrieving revision 1.12
diff -u -r1.12 imagehlp_main.c
--- dlls/imagehlp/imagehlp_main.c	14 Jan 2003 23:43:42 -0000	1.12
+++ dlls/imagehlp/imagehlp_main.c	22 Mar 2003 13:53:43 -0000
@@ -85,8 +85,12 @@
  */
 BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
 {
-  FIXME("(%s): stub\n", debugstr_a(DirPath));
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	if (CreateDirectoryA(DirPath,NULL))
+		return TRUE;
+	if (GetLastError() == ERROR_ALREADY_EXISTS){
+		SetLastError(ERROR_SUCCESS);
+		return TRUE;
+	}
   return FALSE;
 }

Index: objects/dc.c
===================================================================
RCS file: /home/wine/wine/objects/dc.c,v
retrieving revision 1.90
diff -u -r1.90 dc.c
--- objects/dc.c	27 Feb 2003 21:09:45 -0000	1.90
+++ objects/dc.c	22 Mar 2003 13:55:55 -0000
@@ -940,11 +940,12 @@
      * make a lot of sense to me, but that's the way it is.
      */
     if (!dc) return 0;
-    if ((mode > 0) || (mode <= GM_LAST))
+    if ((mode > 0) && (mode <= GM_LAST)) /* changed from || */
     {
         ret = dc->GraphicsMode;
         dc->GraphicsMode = mode;
     }
+	TRACE("changed\n");
     GDI_ReleaseObj( hdc );
     return ret;
 }
@@ -999,6 +1000,7 @@
     if (!dc) return FALSE;
     if (!xform) goto done;

+	TRACE("Setting world transform to %d\n",dc->GraphicsMode);
     /* Check that graphics mode is GM_ADVANCED */
     if (dc->GraphicsMode!=GM_ADVANCED) goto done;

Index: objects/gdiobj.c
===================================================================
RCS file: /home/wine/wine/objects/gdiobj.c,v
retrieving revision 1.85
diff -u -r1.85 gdiobj.c
--- objects/gdiobj.c	21 Jan 2003 19:27:59 -0000	1.85
+++ objects/gdiobj.c	22 Mar 2003 13:56:06 -0000
@@ -795,6 +795,9 @@
 {
     GDIOBJHDR *ptr = NULL;

+	if (!handle)
+		return NULL; /* Handle NULL (even if M$ wouldn't). Am I right? */
+
     _EnterSysLevel( &GDI_level );

     if ((UINT_PTR)handle & 2)  /* GDI heap handle */
@@ -818,7 +821,8 @@
         if (i >= 0 && i < MAX_LARGE_HANDLES)
         {
             ptr = large_handles[i];
-            if (ptr && (magic != MAGIC_DONTCARE) && (GDIMAGIC(ptr->wMagic) != magic)) ptr = NULL;
+            if (ptr && (magic != MAGIC_DONTCARE) && (GDIMAGIC(ptr->wMagic) != magic))
+				ptr = NULL;
         }
     }


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux