Commit in reactos/lib/shlwapi on MAIN
Makefile.in+11.2 -> 1.3
Makefile.ros-template+3-21.2 -> 1.3
assoc.c+12-31.3 -> 1.4
ordinal.c+111.4 -> 1.5
shlwapi.spec+6-51.3 -> 1.4
string.c+67-21.4 -> 1.5
+100-12
6 modified files
Sync to Wine-20040213
* Jon Griffiths <jon_p_griffiths@yahoo.com>
  Add some missing prototypes, fix AssocIsDangerous.
  Implement StrRetToBSTR, delay-import oleaut32.
* Alexandre Julliard
  Only link against libdxguid where necessary.
* Juan Lang <juan_lang@yahoo.com>
  Stub for MLIsMLHInstance.
* Francois Gouget <fgouget@free.fr>
  Add missing '\n's to debug traces.

reactos/lib/shlwapi
Makefile.in 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Makefile.in	28 Jan 2004 21:57:41 -0000	1.2
+++ Makefile.in	19 Feb 2004 21:19:27 -0000	1.3
@@ -5,6 +5,7 @@
 VPATH     = @srcdir@
 MODULE    = shlwapi.dll
 IMPORTS   = ole32 user32 gdi32 advapi32 kernel32
+DELAYIMPORTS = oleaut32
 EXTRALIBS = -luuid $(LIBUNICODE)
 
 C_SRCS = \

reactos/lib/shlwapi
Makefile.ros-template 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Makefile.ros-template	3 Jan 2004 23:45:25 -0000	1.2
+++ Makefile.ros-template	19 Feb 2004 21:19:27 -0000	1.3
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2 2004/01/03 23:45:25 sedwards Exp $
+# $Id: Makefile.ros-template,v 1.3 2004/02/19 21:19:27 gvg Exp $
 
 TARGET_NAME = shlwapi
 
@@ -6,7 +6,8 @@
 
 TARGET_CFLAGS = -D__REACTOS__ @EXTRADEFS@
 
-TARGET_SDKLIBS = @IMPORTS@ libwine.a wine_uuid.a ntdll.a libwine_unicode.a
+# FIXME: we don't do delayed imports yet so oleaut32.a is listed explicitly
+TARGET_SDKLIBS = @IMPORTS@ oleaut32.a libwine.a wine_uuid.a ntdll.a libwine_unicode.a
 
 TARGET_NORC = yes
 

reactos/lib/shlwapi
assoc.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- assoc.c	2 Jan 2004 19:49:46 -0000	1.3
+++ assoc.c	19 Feb 2004 21:19:27 -0000	1.4
@@ -414,11 +414,20 @@
 
 /**************************************************************************
  *  AssocIsDangerous  (SHLWAPI.@)
+ *  
+ * Determine if a file association is dangerous (potentially malware).
+ *
+ * PARAMS
+ *  lpszAssoc [I] Name of file or file extention to check.
+ *
+ * RETURNS
+ *  TRUE, if lpszAssoc may potentially be malware (executable),
+ *  FALSE, Otherwise.
  */
-HRESULT WINAPI AssocIsDangerous( ASSOCSTR str )
+BOOL WINAPI AssocIsDangerous(LPCWSTR lpszAssoc)
 {
-    FIXME("%08x\n", str);
-    return S_FALSE;
+    FIXME("%s\n", debugstr_w(lpszAssoc));
+    return FALSE;
 }
 
 /**************************************************************************

reactos/lib/shlwapi
ordinal.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ordinal.c	28 Jan 2004 21:57:41 -0000	1.4
+++ ordinal.c	19 Feb 2004 21:19:27 -0000	1.5
@@ -3678,6 +3678,17 @@
 }
 
 /*************************************************************************
+ *      @      [SHLWAPI.429]
+ * FIXME I have no idea what this function does or what its arguments are.
+ */
+BOOL WINAPI MLIsMLHInstance(HINSTANCE hInst)
+{
+       FIXME("(%p) stub\n", hInst);
+       return FALSE;
+}
+
+
+/*************************************************************************
  *      @	[SHLWAPI.430]
  */
 DWORD WINAPI MLSetMLHInstance(HINSTANCE hInst, HANDLE hHeap)

reactos/lib/shlwapi
shlwapi.spec 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- shlwapi.spec	28 Jan 2004 21:57:41 -0000	1.3
+++ shlwapi.spec	19 Feb 2004 21:19:27 -0000	1.4
@@ -426,7 +426,7 @@
 426 stub -noname DestroyMenuWrap
 427 stub -noname TrackPopupMenuWrap
 428 stdcall @(long long long long long ptr) user32.TrackPopupMenuEx
-429 stub -noname MLIsMLHInstance
+429 stdcall -noname MLIsMLHInstance(long)
 430 stdcall -noname MLSetMLHInstance(long long)
 431 stdcall -noname MLClearMLHInstance(long)
 432 stub -noname SHSendMessageBroadcastA
@@ -796,10 +796,11 @@
 
 # exported in later versions
 @ stdcall AssocIsDangerous(long)
-@ stdcall StrRetToBufA (ptr ptr ptr long)
-@ stdcall StrRetToBufW (ptr ptr ptr long)
-@ stdcall StrRetToStrA (ptr ptr ptr)
-@ stdcall StrRetToStrW (ptr ptr ptr)
+@ stdcall StrRetToBufA(ptr ptr ptr long)
+@ stdcall StrRetToBufW(ptr ptr ptr long)
+@ stdcall StrRetToBSTR(ptr ptr ptr)
+@ stdcall StrRetToStrA(ptr ptr ptr)
+@ stdcall StrRetToStrW(ptr ptr ptr)
 @ stdcall SHRegGetPathA(long str str ptr long)
 @ stdcall SHRegGetPathW(long wstr wstr ptr long)
 @ stdcall PathIsDirectoryEmptyA(str)

reactos/lib/shlwapi
string.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- string.c	28 Jan 2004 21:57:41 -0000	1.4
+++ string.c	19 Feb 2004 21:19:27 -0000	1.5
@@ -1333,7 +1333,7 @@
  *
  * PARAMS
  *  lpStrRet [O] STRRET to convert
- *  pIdl     [I] ITEMIDLIST for lpStrRet->uType = STRRET_OFFSETA
+ *  pIdl     [I] ITEMIDLIST for lpStrRet->uType == STRRET_OFFSET
  *  lpszDest [O] Destination for normal string
  *  dwLen    [I] Length of lpszDest
  *
@@ -1444,7 +1444,7 @@
  *
  * PARAMS
  *  lpStrRet [O] STRRET to convert
- *  pidl     [I] ITEMIDLIST for lpStrRet->uType = STRRET_OFFSETA
+ *  pidl     [I] ITEMIDLIST for lpStrRet->uType == STRRET_OFFSET
  *  ppszName [O] Destination for converted string
  *
  * RETURNS
@@ -1508,6 +1508,71 @@
   return hRet;
 }
 
+/* Create an ASCII string copy using SysAllocString() */
+static HRESULT _SHStrDupAToBSTR(LPCSTR src, BSTR *pBstrOut)
+{
+    *pBstrOut = NULL;
+
+    if (src)
+    {
+        INT len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
+        WCHAR* szTemp = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+
+        if (szTemp)
+        {
+            MultiByteToWideChar(CP_ACP, 0, src, -1, szTemp, len);
+            *pBstrOut = SysAllocString(szTemp);
+            HeapFree(GetProcessHeap(), 0, szTemp);
+
+            if (*pBstrOut)
+                return S_OK;
+        }
+    }
+    return E_OUTOFMEMORY;
+}
+
+/*************************************************************************
+ * StrRetToBSTR	[SHLWAPI.@]
+ *
+ * Converts a STRRET to a BSTR.
+ *
+ * PARAMS
+ *  lpStrRet [O] STRRET to convert
+ *  pidl     [I] ITEMIDLIST for lpStrRet->uType = STRRET_OFFSET
+ *  pBstrOut [O] Destination for converted BSTR
+ *
+ * RETURNS
+ *  Success: S_OK. pBstrOut contains the new string.
+ *  Failure: E_FAIL, if any parameters are invalid.
+ */
+HRESULT WINAPI StrRetToBSTR(STRRET *lpStrRet, LPCITEMIDLIST pidl, BSTR* pBstrOut)
+{
+  HRESULT hRet = E_FAIL;
+
+  switch (lpStrRet->uType)
+  {
+  case STRRET_WSTR:
+    *pBstrOut = SysAllocString(lpStrRet->u.pOleStr);
+    if (*pBstrOut)
+      hRet = S_OK;
+    CoTaskMemFree(lpStrRet->u.pOleStr);
+    break;
+
+  case STRRET_CSTR:
+    hRet = _SHStrDupAToBSTR(lpStrRet->u.cStr, pBstrOut);
+    break;
+
+  case STRRET_OFFSET:
+    hRet = _SHStrDupAToBSTR(((LPCSTR)&pidl->mkid) + lpStrRet->u.uOffset, pBstrOut);
+    break;
+
+  default:
+    *pBstrOut = NULL;
+  }
+
+  return hRet;
+}
+
 /*************************************************************************
  * StrFormatKBSizeA	[SHLWAPI.@]
  *
CVSspam 0.2.8