Commit in reactos/lib/shlwapi on MAIN
Makefile.in+1-11.5 -> 1.6
ordinal.c+16-21.8 -> 1.9
shlwapi.spec+1-11.6 -> 1.7
stopwatch.c+15-121.1 -> 1.2
url.c+3-11.7 -> 1.8
+36-17
5 modified files
Sync to Wine-20040615:
Hans Leidekker <hans@it.vu.nl>
- Link to ntdll.
Raphael Junqueira <fenix@club-internet.fr>
- Stub for SHFlushSFCacheWrap.
Eric Pouech <pouech-eric@wanadoo.fr>
- GetModuleFileName[AW] doesn't terminate the string if the buffer is
  too small.
Stefan Leichter <Stefan.Leichter@camLine.com>
- Moved stub of StopWatch from ascii to unicode.

reactos/lib/shlwapi
Makefile.in 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- Makefile.in	16 Apr 2004 08:47:55 -0000	1.5
+++ Makefile.in	16 Jun 2004 18:27:33 -0000	1.6
@@ -4,7 +4,7 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shlwapi.dll
-IMPORTS   = ole32 user32 gdi32 advapi32 kernel32
+IMPORTS   = ole32 user32 gdi32 advapi32 kernel32 ntdll
 DELAYIMPORTS = oleaut32
 EXTRALIBS = -luuid $(LIBUNICODE)
 

reactos/lib/shlwapi
ordinal.c 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- ordinal.c	8 May 2004 13:49:05 -0000	1.8
+++ ordinal.c	16 Jun 2004 18:27:33 -0000	1.9
@@ -3265,9 +3265,12 @@
    */
     CHAR mod_path[2*MAX_PATH];
     LPSTR ptr;
+    DWORD len;
 
     FIXME("(%s,%p,0x%08lx) semi-stub!\n", debugstr_a(new_mod), inst_hwnd, dwFlags);
-    GetModuleFileNameA(inst_hwnd, mod_path, 2*MAX_PATH);
+    len = GetModuleFileNameA(inst_hwnd, mod_path, sizeof(mod_path));
+    if (!len || len >= sizeof(mod_path)) return NULL;
+
     ptr = strrchr(mod_path, '\\');
     if (ptr) {
 	strcpy(ptr+1, new_mod);
@@ -3286,9 +3289,12 @@
 {
     WCHAR mod_path[2*MAX_PATH];
     LPWSTR ptr;
+    DWORD len;
 
     FIXME("(%s,%p,0x%08lx) semi-stub!\n", debugstr_w(new_mod), inst_hwnd, dwFlags);
-    GetModuleFileNameW(inst_hwnd, mod_path, 2*MAX_PATH);
+    len = GetModuleFileNameW(inst_hwnd, mod_path, sizeof(mod_path) / sizeof(WCHAR));
+    if (!len || len >= sizeof(mod_path) / sizeof(WCHAR)) return NULL;
+
     ptr = strrchrW(mod_path, '\\');
     if (ptr) {
 	strcpyW(ptr+1, new_mod);
@@ -3507,6 +3513,14 @@
 }
 
 /*************************************************************************
+ *      @	[SHLWAPI.419]
+ */
+BOOL WINAPI SHFlushSFCacheWrap(void) {
+  FIXME(": stub\n");
+  return TRUE;
+}
+
+/*************************************************************************
  *      @      [SHLWAPI.429]
  * FIXME I have no idea what this function does or what its arguments are.
  */

reactos/lib/shlwapi
shlwapi.spec 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- shlwapi.spec	16 Apr 2004 08:47:55 -0000	1.6
+++ shlwapi.spec	16 Jun 2004 18:27:33 -0000	1.7
@@ -416,7 +416,7 @@
 416 stub -noname SHWinHelpOnDemandW
 417 stub -noname SHWinHelpOnDemandA
 418 stdcall -noname MLFreeLibrary(long)
-419 stub -noname SHFlushSFCacheWrap
+419 stdcall -noname SHFlushSFCacheWrap()
 420 stub @ # CMemStream::Commit
 421 stub -noname SHLoadPersistedDataObject
 422 stdcall -noname _SHGlobalCounterCreateNamedA(str long)

reactos/lib/shlwapi
stopwatch.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- stopwatch.c	11 Mar 2004 22:30:40 -0000	1.1
+++ stopwatch.c	16 Jun 2004 18:27:33 -0000	1.2
@@ -38,6 +38,7 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "winreg.h"
+#include "winternl.h"
 #define NO_SHLWAPI_STREAM
 #include "shlwapi.h"
 #include "wine/debug.h"
@@ -81,9 +82,8 @@
   FIXME("() stub!\n");
 }
 
-
 /*************************************************************************
- *      @	[SHLWAPI.243]
+ *      @	[SHLWAPI.244]
  *
  * Write a performance event to a log file
  *
@@ -98,28 +98,31 @@
  *  Success: ERROR_SUCCESS.
  *  Failure: A standard Win32 error code indicating the failure.
  */
-DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
+DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
                         DWORD dwMode, DWORD dwTimeStamp)
 {
-  FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_a(lpszStr),
+    FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr),
         dwUnknown, dwMode, dwTimeStamp);
   return ERROR_SUCCESS;
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.244]
+ *      @	[SHLWAPI.243]
  *
- * See StopWatchA.
+ * See StopWatchW.
  */
-DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
+DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
                         DWORD dwMode, DWORD dwTimeStamp)
-{
-  char szBuff[MAX_PATH];
+{   DWORD retval;
+    UNICODE_STRING szStrW;
+
+    if(lpszStr) RtlCreateUnicodeStringFromAsciiz(&szStrW, lpszStr);
+    else szStrW.Buffer = NULL;
 
-  if(!WideCharToMultiByte(0, 0, lpszStr, -1, szBuff, MAX_PATH, 0, 0))
-    return ERROR_NOT_ENOUGH_MEMORY;
+    retval = StopWatchW(dwClass, szStrW.Buffer, dwUnknown, dwMode, dwTimeStamp);
 
-  return StopWatchA(dwClass, szBuff, dwUnknown, dwMode, dwTimeStamp);
+    RtlFreeUnicodeString(&szStrW);
+    return retval;
 }
 
 /*************************************************************************

reactos/lib/shlwapi
url.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- url.c	8 May 2004 13:49:05 -0000	1.7
+++ url.c	16 Jun 2004 18:27:33 -0000	1.8
@@ -2428,8 +2428,10 @@
     if (hMod)
     {
       WCHAR szBuff[MAX_PATH];
+      DWORD len;
 
-      if (GetModuleFileNameW(hMod, szBuff, sizeof(szBuff)/sizeof(WCHAR)))
+      len = GetModuleFileNameW(hMod, szBuff, sizeof(szBuff)/sizeof(WCHAR));
+      if (len && len < sizeof(szBuff)/sizeof(WCHAR))
       {
         DWORD dwPathLen = strlenW(szBuff) + 1;
 
CVSspam 0.2.8