Sync(17): msvcrt pgm

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

 



Hi,

License: X11

ChangeLog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>
  +dlls/msvcrt/msvcrt.spec dls/msvcrt/data.c
    Implement __p__wpgmptr, _wpgmptr
    Avoid using static storage for pgm pointers

=====
"Don't wait for the seas to part, or messiahs to come;
 Don't you sit around and waste this chance..." - Live

jon_p_griffiths@yahoo.com

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- wine/dlls/msvcrt/msvcrt.spec	Fri Jul  4 17:46:43 2003
+++ wine-develop/dlls/msvcrt/msvcrt.spec	Sat Jul 12 17:41:24 2003
@@ -128,7 +128,7 @@
 @ cdecl __p__winmajor()
 @ cdecl __p__winminor()
 @ cdecl __p__winver()
-@ stub __p__wpgmptr #()
+@ cdecl __p__wpgmptr()
 @ stub __pioinfo #()
 @ stub __pxcptinfoptrs #()
 @ cdecl __set_app_type(long) MSVCRT___set_app_type
@@ -533,7 +533,7 @@
 @ cdecl _wmktemp(wstr)
 @ varargs _wopen(wstr long)
 @ stub _wperror #(wstr)
-@ stub _wpgmptr # extern
+@ extern _wpgmptr MSVCRT__wpgmptr
 @ stub _wpopen #(wstr wstr)
 @ cdecl _wputenv(wstr)
 @ cdecl _wremove(wstr)
--- wine/dlls/msvcrt/data.c	Tue Mar 18 14:14:48 2003
+++ wine-develop/dlls/msvcrt/data.c	Sat Jul 12 17:44:41 2003
@@ -62,8 +62,8 @@
 MSVCRT_wchar_t **MSVCRT___winitenv = 0;
 int MSVCRT_timezone;
 int MSVCRT_app_type;
-char MSVCRT_pgm[MAX_PATH];
 char* MSVCRT__pgmptr = 0;
+WCHAR* MSVCRT__wpgmptr = 0;
 
 /* Get a snapshot of the current environment
  * and construct the __p__environ array
@@ -156,6 +156,11 @@
 char** __p__pgmptr(void) { return &MSVCRT__pgmptr; }
 
 /***********************************************************************
+ *              __p__wpgmptr (MSVCRT.@)
+ */
+WCHAR** __p__wpgmptr(void) { return &MSVCRT__wpgmptr; }
+
+/***********************************************************************
  *		__p__fmode (MSVCRT.@)
  */
 unsigned int* __p__fmode(void) { return &MSVCRT__fmode; }
@@ -284,9 +289,13 @@
   MSVCRT___initenv= msvcrt_SnapshotOfEnvironmentA(NULL);
   MSVCRT___winitenv= msvcrt_SnapshotOfEnvironmentW(NULL);
 
-  MSVCRT_pgm[0] = '\0';
-  GetModuleFileNameA(0, MSVCRT_pgm, sizeof(MSVCRT_pgm)/sizeof(MSVCRT_pgm[0]));
-  MSVCRT__pgmptr = MSVCRT_pgm;
+  MSVCRT__pgmptr = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
+  if (MSVCRT__pgmptr)
+    GetModuleFileNameA(0, MSVCRT__pgmptr, MAX_PATH);
+
+  MSVCRT__wpgmptr = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
+  if (MSVCRT__wpgmptr)
+    GetModuleFileNameW(0, MSVCRT__wpgmptr, MAX_PATH);
 }
 
 
@@ -294,10 +303,12 @@
 void msvcrt_free_args(void)
 {
   /* FIXME: more things to free */
-  if (MSVCRT___initenv) HeapFree(GetProcessHeap(), 0,MSVCRT___initenv);
-  if (MSVCRT___winitenv) HeapFree(GetProcessHeap(), 0,MSVCRT___winitenv);
-  if (MSVCRT__environ) HeapFree(GetProcessHeap(), 0,MSVCRT__environ);
-  if (MSVCRT__wenviron) HeapFree(GetProcessHeap(), 0,MSVCRT__wenviron);
+  if (MSVCRT___initenv) HeapFree(GetProcessHeap(), 0, MSVCRT___initenv);
+  if (MSVCRT___winitenv) HeapFree(GetProcessHeap(), 0, MSVCRT___winitenv);
+  if (MSVCRT__environ) HeapFree(GetProcessHeap(), 0, MSVCRT__environ);
+  if (MSVCRT__wenviron) HeapFree(GetProcessHeap(), 0, MSVCRT__wenviron);
+  if (MSVCRT__pgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr);
+  if (MSVCRT__wpgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);
 }
 
 /*********************************************************************

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

  Powered by Linux