implement a ordinal 167 and 171

György 'Nog' Jeney nog at sdf.lonestar.org
Sun Dec 15 04:05:30 CST 2002


This is an updated patch over the last one.  This basically fixes  ordinal
167
which is supposed to return the previous window handle.  It also adds the
function name SHCreateThread.  The function is actually exported as
ordinal 566 but ordinal 16 also points to this function.

ChangeLog:
 * dlls/shlwapi/ordinal.c
 * dlls/shlwapi/shlwapi.spec
   - Implement ordinals 167 and 171
   - Add stubs for ordinals 282 and 406
   - Add ordinal 566 and SHCreateThread

nog.


-------------- next part --------------
--- ../cleanwine/dlls/shlwapi/ordinal.c	2002-12-11 08:17:09.000000000 +0200
+++ dlls/shlwapi/ordinal.c	2002-12-15 11:53:11.000000000 +0200
@@ -976,22 +976,32 @@
 /*************************************************************************
  *      @	[SHLWAPI.167]
  *
- * Change a windows parent.
+ * Change a window's parent.
  *
  * PARAMS
  *  hWnd       [I] Window to change parent of
  *  hWndParent [I] New parent window
  *
  * RETURNS
- *  Nothing.
+ *  The old parent of hWnd.
  *
  * NOTES
  *  If hWndParent is NULL (desktop), the window style is changed to WS_POPUP.
+ *  If hWndParent is NOT NULL then we set the WS_CHILD style.
  */
-DWORD WINAPI SHLWAPI_167(HWND hWnd, HWND hWndParent)
+HWND WINAPI SHLWAPI_167(HWND hWnd, HWND hWndParent)
 {
-	FIXME("%p,%p\n", hWnd, hWndParent);
-	return 0;
+  TRACE("%p, %p\n", hWnd, hWndParent);
+
+  if(GetParent(hWnd) == hWndParent)
+    return 0;
+
+  if(hWndParent)
+    SHLWAPI_165(hWnd, GWL_STYLE, WS_CHILD, WS_CHILD);
+  else
+    SHLWAPI_165(hWnd, GWL_STYLE, WS_POPUP, WS_POPUP);
+
+  return SetParent(hWnd, hWndParent);
 }
 
 /*************************************************************************
@@ -1100,12 +1110,40 @@
 /*************************************************************************
  *      @		[SHLWAPI.171]
  *
- * _SHIsSameObject
+ * Check the two interfaces if they come from the same object.
+ *
+ * PARAMS
+ *   lpInt1 [I]: Interface to check against lpInt2.
+ *   lpInt2 [I]: Interface to check against lpInt1.
+ *
+ * RETURNS
+ *   TRUE: Interfaces come from the same object.
+ *   FALSE: Interfaces come from different objects.
  */
-BOOL WINAPI SHLWAPI_171(LPVOID x, LPVOID y)
+BOOL WINAPI SHLWAPI_171(IUnknown* lpInt1, IUnknown* lpInt2)
 {
-	FIXME("%p %p\n",x,y);
-	return 0;
+  LPVOID lpUnknown1, lpUnknown2;
+
+  TRACE("%p %p\n", lpInt1, lpInt2);
+
+  if (!lpInt1 || !lpInt2)
+    return FALSE;
+
+  if (lpInt1 == lpInt2)
+    return TRUE;
+
+  if (!SUCCEEDED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown,
+                                       (LPVOID *)&lpUnknown1)))
+    return FALSE;
+
+  if (!SUCCEEDED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown,
+                                       (LPVOID *)&lpUnknown2)))
+    return FALSE;
+
+  if (lpUnknown1 == lpUnknown2)
+    return TRUE;
+  
+  return FALSE;
 }
 
 /*************************************************************************
@@ -2055,6 +2093,18 @@
 }
 
 /*************************************************************************
+ *      @       [SHLWAPI.282]
+ *
+ * This function seems to be a forward to SHLWAPI.281 (whatever THAT
+ * function does...).
+ */
+HRESULT WINAPI SHLWAPI_282(LPVOID w, LPVOID x, LPVOID y, LPVOID z)
+{
+  FIXME("%p %p %p %p\n", w, x, y, z);
+  return E_FAIL;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.284]
  *
  * _IConnectionPoint_SimpleInvoke
@@ -2529,6 +2579,15 @@
 }
 
 /*************************************************************************
+ *      @       [SHLWAPI.406]
+ */
+DWORD WINAPI SHLWAPI_406(LPVOID u, LPVOID v, LPVOID w, LPVOID x, LPVOID y, LPVOID z)
+{
+  FIXME("%p %p %p %p %p %p\n", u, v, w, x, y, z);
+  return 0;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.413]
  *
  * Function unknown seems to always to return 0
--- ../cleanwine/dlls/shlwapi/shlwapi.spec	2002-12-10 19:04:27.000000000 +0200
+++ dlls/shlwapi/shlwapi.spec	2002-12-15 12:01:59.000000000 +0200
@@ -279,7 +279,7 @@
 279 stub @
 280 stub @
 281 stdcall @(ptr ptr ptr ptr) SHLWAPI_281
-282 stub @
+282 stdcall @(ptr ptr ptr ptr) SHLWAPI_282
 283 stub @
 284 stdcall @(ptr ptr ptr) SHLWAPI_284
 285 stub @
@@ -403,7 +403,7 @@
 403 stdcall @(ptr) SHLWAPI_403
 404 stdcall ColorHLSToRGB(long long long) ColorHLSToRGB
 405 stub @
-406 stub @
+406 stdcall @(ptr ptr ptr ptr ptr ptr) SHLWAPI_406
 407 stub @
 408 stub @
 409 stub @
@@ -445,6 +445,8 @@
 445 stdcall ColorRGBToHLS(long ptr ptr ptr) ColorRGBToHLS
 446 stub @
 
+566 stdcall SHCreateThread(ptr ptr long ptr) SHCreateThread
+
 @ stdcall DllGetVersion (ptr) SHLWAPI_DllGetVersion
 @ stdcall GetMenuPosFromID(ptr long) GetMenuPosFromID
 @ stdcall HashData (ptr long ptr long) HashData



More information about the wine-patches mailing list