reactos/lib/shlwapi
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
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
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;