Author: dchapyshev
Date: Sat May 9 13:22:03 2009
New Revision: 40848
URL:
http://svn.reactos.org/svn/reactos?rev=40848&view=rev
Log:
- Sync xinput1_3, pdh with Wine 1.1.21
Modified:
trunk/reactos/dll/win32/pdh/pdh.spec
trunk/reactos/dll/win32/pdh/pdh_main.c
trunk/reactos/dll/win32/xinput1_3/xinput1_3.spec
Modified: trunk/reactos/dll/win32/pdh/pdh.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/pdh/pdh.spec?rev…
==============================================================================
--- trunk/reactos/dll/win32/pdh/pdh.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/pdh/pdh.spec [iso-8859-1] Sat May 9 13:22:03 2009
@@ -79,8 +79,8 @@
@ stdcall PdhLookupPerfIndexByNameW(wstr wstr ptr)
@ stdcall PdhLookupPerfNameByIndexA(str long ptr ptr)
@ stdcall PdhLookupPerfNameByIndexW(wstr long ptr ptr)
-@ stub PdhMakeCounterPathA
-@ stub PdhMakeCounterPathW
+@ stdcall PdhMakeCounterPathA(ptr ptr ptr long)
+@ stdcall PdhMakeCounterPathW(ptr ptr ptr long)
@ stub PdhOpenLogA
@ stub PdhOpenLogW
@ stdcall PdhOpenQuery(wstr long ptr) PdhOpenQueryW
Modified: trunk/reactos/dll/win32/pdh/pdh_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/pdh/pdh_main.c?r…
==============================================================================
--- trunk/reactos/dll/win32/pdh/pdh_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/pdh/pdh_main.c [iso-8859-1] Sat May 9 13:22:03 2009
@@ -1061,6 +1061,110 @@
}
/***********************************************************************
+ * PdhMakeCounterPathA (PDH.@)
+ */
+PDH_STATUS WINAPI PdhMakeCounterPathA( PDH_COUNTER_PATH_ELEMENTS_A *e, LPSTR buffer,
+ LPDWORD buflen, DWORD flags )
+{
+ PDH_STATUS ret = PDH_MEMORY_ALLOCATION_FAILURE;
+ PDH_COUNTER_PATH_ELEMENTS_W eW;
+ WCHAR *bufferW;
+ DWORD buflenW;
+
+ TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
+
+ if (!e || !buflen) return PDH_INVALID_ARGUMENT;
+
+ memset( &eW, 0, sizeof(eW) );
+ if (e->szMachineName && !(eW.szMachineName = pdh_strdup_aw(
e->szMachineName ))) goto done;
+ if (e->szObjectName && !(eW.szObjectName = pdh_strdup_aw(
e->szObjectName ))) goto done;
+ if (e->szInstanceName && !(eW.szInstanceName = pdh_strdup_aw(
e->szInstanceName ))) goto done;
+ if (e->szParentInstance && !(eW.szParentInstance = pdh_strdup_aw(
e->szParentInstance ))) goto done;
+ if (e->szCounterName && !(eW.szCounterName = pdh_strdup_aw(
e->szCounterName ))) goto done;
+ eW.dwInstanceIndex = e->dwInstanceIndex;
+
+ buflenW = 0;
+ ret = PdhMakeCounterPathW( &eW, NULL, &buflenW, flags );
+ if (ret == PDH_MORE_DATA)
+ {
+ if ((bufferW = heap_alloc( buflenW * sizeof(WCHAR) )))
+ {
+ if (!(ret = PdhMakeCounterPathW( &eW, bufferW, &buflenW, flags )))
+ {
+ int len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL,
NULL);
+ if (*buflen >= len) WideCharToMultiByte(CP_ACP, 0, bufferW, -1,
buffer, *buflen, NULL, NULL);
+ else ret = PDH_MORE_DATA;
+ *buflen = len;
+ }
+ heap_free( bufferW );
+ }
+ }
+
+done:
+ heap_free( eW.szMachineName );
+ heap_free( eW.szObjectName );
+ heap_free( eW.szInstanceName );
+ heap_free( eW.szParentInstance );
+ heap_free( eW.szCounterName );
+ return ret;
+}
+
+/***********************************************************************
+ * PdhMakeCounterPathW (PDH.@)
+ */
+PDH_STATUS WINAPI PdhMakeCounterPathW( PDH_COUNTER_PATH_ELEMENTS_W *e, LPWSTR buffer,
+ LPDWORD buflen, DWORD flags )
+{
+ static const WCHAR bslash[] = {'\\',0};
+ static const WCHAR fslash[] = {'/',0};
+ static const WCHAR lparen[] = {'(',0};
+ static const WCHAR rparen[] = {')',0};
+ static const WCHAR fmt[] = {'#','%','u',0};
+
+ WCHAR path[PDH_MAX_COUNTER_NAME], instance[12];
+ PDH_STATUS ret = ERROR_SUCCESS;
+ DWORD len;
+
+ TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
+
+ if (flags) FIXME("unimplemented flags 0x%08x\n", flags);
+
+ if (!e || !e->szCounterName || !e->szObjectName || !buflen)
+ return PDH_INVALID_ARGUMENT;
+
+ path[0] = 0;
+ if (e->szMachineName)
+ {
+ strcatW(path, bslash);
+ strcatW(path, bslash);
+ strcatW(path, e->szMachineName);
+ }
+ strcatW(path, bslash);
+ strcatW(path, e->szObjectName);
+ if (e->szInstanceName)
+ {
+ strcatW(path, lparen);
+ if (e->szParentInstance)
+ {
+ strcatW(path, e->szParentInstance);
+ strcatW(path, fslash);
+ }
+ strcatW(path, e->szInstanceName);
+ sprintfW(instance, fmt, e->dwInstanceIndex);
+ strcatW(path, instance);
+ strcatW(path, rparen);
+ }
+ strcatW(path, bslash);
+ strcatW(path, e->szCounterName);
+
+ len = strlenW(path) + 1;
+ if (*buflen >= len) strcpyW(buffer, path);
+ else ret = PDH_MORE_DATA;
+ *buflen = len;
+ return ret;
+}
+
+/***********************************************************************
* PdhEnumObjectItemsA (PDH.@)
*/
PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR szDataSource, LPCSTR szMachineName, LPCSTR
szObjectName,
Modified: trunk/reactos/dll/win32/xinput1_3/xinput1_3.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/xinput1_3/xinput…
==============================================================================
--- trunk/reactos/dll/win32/xinput1_3/xinput1_3.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/xinput1_3/xinput1_3.spec [iso-8859-1] Sat May 9 13:22:03
2009
@@ -1,7 +1,8 @@
-@ stdcall XInputEnable(long)
-@ stdcall XInputSetState(long ptr)
-@ stdcall XInputGetState(long ptr)
-@ stdcall XInputGetKeystroke(long long ptr)
-@ stdcall XInputGetCapabilities(long long ptr)
-@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr)
-@ stdcall XInputGetBatteryInformation(long ptr ptr)
+1 stdcall DllMain(long long ptr)
+2 stdcall XInputGetState(long ptr)
+3 stdcall XInputSetState(long ptr)
+4 stdcall XInputGetCapabilities(long long ptr)
+5 stdcall XInputEnable(long)
+6 stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr)
+7 stdcall XInputGetBatteryInformation(long ptr ptr)
+8 stdcall XInputGetKeystroke(long long ptr)