patch shlwapi

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

 



- many stubs
- some ordinals, SHStrDupA and SHStrDupW implemented
Index: wine/dlls/shlwapi/ordinal.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/ordinal.c,v
retrieving revision 1.45
diff -d -u -r1.45 ordinal.c
--- wine/dlls/shlwapi/ordinal.c	16 Jul 2002 01:42:26 -0000	1.45
+++ wine/dlls/shlwapi/ordinal.c	18 Jul 2002 19:33:59 -0000
@@ -2,7 +2,7 @@
  * SHLWAPI ordinal functions
  *
  * Copyright 1997 Marcus Meissner
- *           1998 Jürgen Schmied
+ *           1998 Jrgen Schmied
  *           2001 Jon Griffiths
  *
  * This library is free software; you can redistribute it and/or
@@ -1016,7 +1016,22 @@
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.164]
+ *      _IUnknown_QueryStatus	[SHLWAPI.163]
+ */
+DWORD WINAPI SHLWAPI_163 (
+	LPVOID v,
+	LPVOID w,
+	LPVOID x,
+	LPVOID y,
+	LPVOID z)
+{
+        TRACE("(%p %p %p %p %p) stub\n", v,w,x,y,z);
+	return 0;
+}
+
+
+/*************************************************************************
+ *      _IUnknown_Exec		[SHLWAPI.164]
  */
 DWORD WINAPI SHLWAPI_164 (
 	LPVOID u,
@@ -1046,7 +1061,16 @@
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.169]
+ *      _SHSetParentHwnd	[SHLWAPI.167]
+ */
+DWORD WINAPI SHLWAPI_167(HWND hWnd, LPVOID y)
+{
+	FIXME("0x%08x %p\n", hWnd,y);
+	return 0;
+}
+
+/*************************************************************************
+ *	_IUnknown_AtomicRelease	[SHLWAPI.169]
  *
  *  Do IUnknown::Release on passed object.
  */
@@ -1075,26 +1099,36 @@
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.172]
+ *      _SHIsSameObject		SHLWAPI.171]
+ */
+BOOL WINAPI SHLWAPI_171(LPVOID x, LPVOID y)
+{
+	FIXME("%p %p\n",x,y);
+	return 0;
+}
+
+/*************************************************************************
+ *      _IUnknown_GetWindow	[SHLWAPI.172]
  * Get window handle of OLE object
  */
 DWORD WINAPI SHLWAPI_172 (
-	IUnknown *y,       /* [in]   OLE object interface */
-	LPHWND z)          /* [out]  location to put window handle */
+	IUnknown *pUnk,       /* [in]   OLE object interface */
+	LPHWND hWnd)          /* [out]  location to put window handle */
 {
-        DWORD ret;
-	IUnknown *pv;
+        DWORD ret = E_FAIL;
+	IOleWindow *pOleWnd;
 
-        TRACE("(%p %p)\n",y,z);
-	if (!y) return E_FAIL;
+        TRACE("(%p %p)\n",pUnk,hWnd);
 
-	if ((ret = IUnknown_QueryInterface(y, &IID_IOleWindow,(LPVOID *)&pv)) < 0) {
-	    /* error */
-	    return ret;
+	if (pUnk) {
+	    ret = IUnknown_QueryInterface(pUnk, &IID_IOleWindow,(LPVOID *)&pOleWnd);
+	    if (SUCCEEDED(ret)) {
+	        ret = IOleWindow_GetWindow(pOleWnd, hWnd);
+	        IOleWindow_Release(pOleWnd);
+	        TRACE("result hwnd=%08x\n", *hWnd);
+	    }
 	}
-	ret = IOleWindow_GetWindow((IOleWindow *)pv, z);
-	IUnknown_Release(pv);
-	TRACE("result hwnd=%08x\n", *z);
+
 	return ret;
 }
 
@@ -1152,7 +1186,7 @@
 	return E_FAIL;
 }
 /*************************************************************************
- *      @	[SHLWAPI.176]
+ *      _IUnknown_QueryService	[SHLWAPI.176]
  *
  * Function appears to be interface to IServiceProvider::QueryService
  *
@@ -1165,19 +1199,23 @@
 	IUnknown* unk,    /* [in]    object to give Service Provider */
 	REFGUID   sid,    /* [in]    Service ID                      */
         REFIID    riid,   /* [in]    Function requested              */
-	LPVOID    *z)     /* [out]   place to save interface pointer */
+	LPVOID    *ppv)   /* [out]   place to save interface pointer */
 {
-    DWORD ret;
-    LPVOID aa;
-    *z = 0;
-    if (!unk) return E_FAIL;
-    ret = IUnknown_QueryInterface(unk, &IID_IServiceProvider, &aa);
-    TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, aa);
-    if (ret) return ret;
-    ret = IServiceProvider_QueryService((IServiceProvider *)aa, sid, riid,
-					(void **)z);
-    TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, (LPVOID)*z);
-    IUnknown_Release((IUnknown*)aa);
+    HRESULT ret = E_FAIL;
+    IServiceProvider *pSP;
+    *ppv = 0;
+
+    TRACE("%p, %s, %s, %p\n", unk, debugstr_guid(sid), debugstr_guid(riid), ppv);
+
+    if (unk) {
+        ret = IUnknown_QueryInterface(unk, &IID_IServiceProvider,(LPVOID*) &pSP);
+        TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, pSP);
+        if (SUCCEEDED(ret)) {
+            ret = IServiceProvider_QueryService(pSP, sid, riid, (LPVOID*)ppv);
+            TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, *ppv);
+            IServiceProvider_Release(pSP);
+        }
+    }
     return ret;
 }
 
@@ -1205,6 +1243,15 @@
 }
 
 /*************************************************************************
+ *      _IUnknown_OnFocusOCS	[SHLWAPI.189]
+ */
+DWORD WINAPI SHLWAPI_189(LPVOID x, LPVOID y)
+{
+	FIXME("%p %p\n", x, y);
+	return 0;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.193]
  */
 DWORD WINAPI SHLWAPI_193 ()
@@ -1721,6 +1768,36 @@
 }
 
 /*************************************************************************
+ *      _SHPackDispParamsV	[SHLWAPI.281]
+ */
+HRESULT WINAPI SHLWAPI_281(LPVOID w, LPVOID x, LPVOID y, LPVOID z)
+{
+	FIXME("%p %p %p %p\n",w,x,y,z);
+	return E_FAIL;
+}
+
+/*************************************************************************
+ *      _IConnectionPoint_SimpleInvoke	[SHLWAPI.284]
+ */
+DWORD WINAPI SHLWAPI_284 (
+	LPVOID x,
+	LPVOID y,
+	LPVOID z)
+{
+        TRACE("(%p %p %p) stub\n",x,y,z);
+	return 0;
+}
+
+/*************************************************************************
+ *      _IUnknown_CPContainerOnChanged	[SHLWAPI.287]
+ */
+HRESULT WINAPI SHLWAPI_287(LPVOID x, LPVOID y)
+{
+	FIXME("%p %p\n", x,y);
+	return E_FAIL;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.289]
  *
  * Late bound call to winmm.PlaySoundW
@@ -2194,6 +2271,42 @@
 }
 
 /*************************************************************************
+ *      SHGlobalCounterCreateNamedA	[SHLWAPI.422]
+ */
+HANDLE WINAPI SHLWAPI_422 (LPCSTR pwName, int nInitialCount)
+{
+	CHAR pwCounterName[MAX_PATH];
+	HANDLE hSem;
+
+	lstrcpyA(pwCounterName,	"shell.");
+	lstrcatA(pwCounterName, pwName);
+	hSem = CreateSemaphoreA(NULL /* FIXME */, nInitialCount, MAXLONG, pwCounterName);
+	if (!hSem) {
+	  OpenSemaphoreA( SYNCHRONIZE | SEMAPHORE_MODIFY_STATE, 0, pwCounterName);
+	}
+	return hSem;
+}
+
+/*************************************************************************
+ *      SHGlobalCounterCreateNamedW	[SHLWAPI.423]
+ */
+HANDLE WINAPI SHLWAPI_423 (LPCWSTR pwName, int nInitialCount)
+{
+	WCHAR pwCounterName[MAX_PATH];
+	WCHAR pwShell[7] = {'s','h','e','l','l','.','\0'};
+	HANDLE hSem;
+
+	lstrcpyW(pwCounterName,	pwShell);
+	lstrcatW(pwCounterName, pwName);
+	hSem = CreateSemaphoreW(NULL /* FIXME */, nInitialCount, MAXLONG, pwCounterName);
+	if (!hSem) {
+	  OpenSemaphoreW( SYNCHRONIZE | SEMAPHORE_MODIFY_STATE, 0, pwCounterName);
+	}
+	return hSem;
+}
+
+
+/*************************************************************************
  *      @	[SHLWAPI.418]
  *
  * Function seems to do FreeLibrary plus other things.
@@ -2448,3 +2561,13 @@
     TlsSetValue(SHLWAPI_ThreadRef_index, (LPVOID) punk);
     return S_OK;
 }
+
+
+
+
+
+
+
+
+
+
Index: wine/dlls/shlwapi/reg.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/reg.c,v
retrieving revision 1.28
diff -d -u -r1.28 reg.c
--- wine/dlls/shlwapi/reg.c	31 May 2002 23:40:52 -0000	1.28
+++ wine/dlls/shlwapi/reg.c	18 Jul 2002 19:34:02 -0000
@@ -972,68 +972,6 @@
                           NULL, pwValues, pwValueMax, NULL, NULL, NULL);
 }
 
-/*
-  DWORD dwRet, dwType, dwDataLen;
-
-  FIXME("(hkey=0x%08x,%s,%p,%p,%p,%p=%ld)\n", hKey, debugstr_a(lpszValue),
-        lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0);
-
-  if (pcbData) dwDataLen = *pcbData;
-
-  dwRet = RegQueryValueExA(hKey, lpszValue, lpReserved, &dwType, pvData, &dwDataLen);
-  if (!dwRet)
-  {
-    if (dwType == REG_EXPAND_SZ)
-    {
-      LPSTR szExpand;
-      LPBYTE pData = pvData;
-
-      if (!pData)
-      {
-        if (!pcbData || !(pData = (LPBYTE) LocalAlloc(GMEM_ZEROINIT, *pcbData)))
-          return ERROR_OUTOFMEMORY;
-
-        if ((dwRet = RegQueryValueExA (hKey, lpszValue, lpReserved, &dwType, pData, &dwDataLen)))
-          return dwRet;
-      }
-
-      if (!pcbData && pData != pvData)
-      {
-        WARN("Invalid pcbData would crash under Win32!\n");
-        return ERROR_OUTOFMEMORY;
-      }
-
-      szExpand = (LPBYTE) LocalAlloc(GMEM_ZEROINIT, *pcbData);
-      if (!szExpand)
-      {
-        if ( pData != pvData ) LocalFree((HLOCAL)pData);
-        return ERROR_OUTOFMEMORY;
-      }
-      if ((ExpandEnvironmentStringsA(pvData, szExpand, *pcbData) > 0))
-      {
-        dwDataLen = strlen(szExpand) + 1;
-        strncpy(pvData, szExpand, *pcbData);
-      }
-      else
-      {
-        if ( pData != pvData ) LocalFree((HLOCAL)pData);
-        LocalFree((HLOCAL)szExpand);
-        return GetLastError();
-      }
-      if (pData != pvData) LocalFree((HLOCAL)pData);
-      LocalFree((HLOCAL)szExpand);
-      dwType = REG_SZ;
-    }
-    if (dwType == REG_SZ && pvData && pcbData && dwDataLen >= *pcbData)
-    {
-      ((LPBYTE) pvData)[*pcbData] = '\0';
-    }
-  }
-  if ( pwType ) *pwType = dwType;
-  if ( pcbData ) *pcbData = dwDataLen;
-  return dwRet;
-*/
-
 /*************************************************************************
  * SHQueryValueExA   [SHLWAPI.@]
  *
@@ -1061,6 +999,20 @@
  *   If the type of the data is REG_EXPAND_SZ, it is expanded to REG_SZ. The
  *   value returned will be truncated if it is of type REG_SZ and bigger than
  *   the buffer given to store it.
+ *
+ *   REG_EXPAND_SZ
+ *     case 1: the unexpanded string is smaller than the expanded one
+ *       subcase 1: the buffer is to small to hold the unexpanded string:
+ *          function fails and returns the size of the unexpanded string.
+ *
+ *       subcase 2: buffer is to small to hold the expanded string:
+ *          the function return success (!!) and the result is truncated
+ *	    *** This is clearly a error in the native implemantation. ***
+ *
+ *     case 2: the unexpanded string is bigger than the expanded one
+ *       The buffer must have enough space to hold the unexpanded
+ *       string even if the result is smaller.
+ *
  */
 DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue,
                               LPDWORD lpReserved, LPDWORD pwType,
@@ -1666,3 +1618,13 @@
     TRACE("new key is %08x\n", newKey);
     return newKey;
 }
+
+
+
+
+
+
+
+
+
+
Index: wine/dlls/shlwapi/shlwapi.spec
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/shlwapi.spec,v
retrieving revision 1.42
diff -d -u -r1.42 shlwapi.spec
--- wine/dlls/shlwapi/shlwapi.spec	16 Jul 2002 01:42:26 -0000	1.42
+++ wine/dlls/shlwapi/shlwapi.spec	18 Jul 2002 19:34:03 -0000
@@ -162,15 +162,15 @@
 160 stub @
 161 stub @
 162 stdcall @(str long) SHLWAPI_162
-163 stub @
+163 stdcall @(ptr ptr ptr ptr ptr) SHLWAPI_163
 164 stdcall @(ptr ptr ptr ptr ptr ptr) SHLWAPI_164
 165 stdcall @(long long long long) SHLWAPI_165
 166 stdcall @(ptr) SHLWAPI_166
-167 stub @
+167 stdcall @(long ptr) SHLWAPI_167
 168 stub @
 169 stdcall @(long) SHLWAPI_169
 170 stdcall @(str) SHLWAPI_170
-171 stub @
+171 stdcall @(ptr ptr) SHLWAPI_171
 172 stdcall @(ptr ptr) SHLWAPI_172
 173 stub @
 174 stdcall @(ptr ptr) SHLWAPI_174
@@ -188,7 +188,7 @@
 186 stub @
 187 stub @
 188 stub @
-189 stub @
+189 stdcall @(ptr ptr) SHLWAPI_189
 190 stub @
 191 stub @
 192 stub @
@@ -280,13 +280,13 @@
 278 stdcall @(long long long long long long) SHLWAPI_278
 279 stub @
 280 stub @
-281 stub @
+281 stdcall @(ptr ptr ptr ptr) SHLWAPI_281
 282 stub @
 283 stub @
-284 stub @
+284 stdcall @(ptr ptr ptr) SHLWAPI_284
 285 stub @
 286 stub @
-287 stub @
+287 stdcall @(ptr ptr) SHLWAPI_287
 288 stub @
 289 stdcall @(wstr long long) SHLWAPI_289
 290 stub @
@@ -421,8 +421,8 @@
 419 stub @
 420 stub @
 421 stub @
-422 stub @
-423 stub @
+422 stdcall @(str long) SHLWAPI_422
+423 stdcall @(wstr long) SHLWAPI_423
 424 stub @
 425 stub @
 426 stub @
@@ -720,8 +720,13 @@
 @ stub    SHRegisterValidateTemplate
 @ stdcall SHSetThreadRef (ptr) SHSetThreadRef
 @ stub    SHSkipJunction
-@ stub    SHStrDupA
-@ stub    SHStrDupW
+@ stdcall SHStrDupA (str ptr) SHStrDupA
+@ stdcall SHStrDupW (wstr ptr) SHStrDupW
 @ stub    StrFormatByteSize64A
 @ stub    StrFormatKBSizeA
 @ stub    StrFormatKBSizeW
+
+
+
+
+
Index: wine/dlls/shlwapi/string.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/string.c,v
retrieving revision 1.23
diff -d -u -r1.23 string.c
--- wine/dlls/shlwapi/string.c	2 Jul 2002 02:06:19 -0000	1.23
+++ wine/dlls/shlwapi/string.c	18 Jul 2002 19:34:04 -0000
@@ -634,3 +634,60 @@
     TRACE("<- '%s'\n", pszSource);
     return trimmed;
 }
+
+/*************************************************************************
+ *      SHStrDupA	[SHLWAPI.@]
+ *
+ * Duplicates a ASCII string to UNICODE. The destination buffer is allocated.
+ */
+HRESULT WINAPI SHStrDupA(LPCSTR src, LPWSTR * dest)
+{
+	HRESULT hr;
+	int len = 0;
+
+	if (src) {
+	    len = (MultiByteToWideChar(0,0,src,-1,0,0) + 1)* sizeof(WCHAR);
+	    *dest = CoTaskMemAlloc(len);
+	} else {
+	    *dest = NULL;
+	}
+
+	if (*dest) {
+	    MultiByteToWideChar(0,0,src,-1,*dest,len);
+	    hr = S_OK;
+	} else {
+	    hr = E_OUTOFMEMORY;
+	}
+
+	TRACE("%s->(%p)\n", debugstr_a(src), *dest);
+	return hr;
+}
+
+/*************************************************************************
+ *      SHStrDupW	[SHLWAPI.@]
+ *
+ * Duplicates a UNICODE string. The destination buffer is allocated.
+ */
+HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR * dest)
+{
+	HRESULT hr;
+	int len = 0;
+
+	if (src) {
+	    len = (lstrlenW(src) + 1) * sizeof(WCHAR);
+	    *dest = CoTaskMemAlloc(len);
+	} else {
+	    *dest = NULL;
+	}
+
+	if (*dest) {
+	    memcpy(*dest, src, len);
+	    hr = S_OK;
+	} else {
+	    hr = E_OUTOFMEMORY;
+	}
+
+	TRACE("%s->(%p)\n", debugstr_w(src), *dest);
+	return hr;
+}
+

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

  Powered by Linux