Author: akhaldi
Date: Thu Sep 26 14:04:52 2013
New Revision: 60360
URL:
http://svn.reactos.org/svn/reactos?rev=60360&view=rev
Log:
[PDH]
* Sync with Wine 1.7.1.
CORE-7469
Modified:
trunk/reactos/dll/win32/pdh/CMakeLists.txt
trunk/reactos/dll/win32/pdh/pdh_main.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/pdh/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/pdh/CMakeLists.t…
==============================================================================
--- trunk/reactos/dll/win32/pdh/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/pdh/CMakeLists.txt [iso-8859-1] Thu Sep 26 14:04:52 2013
@@ -1,11 +1,9 @@
-
-add_definitions(-D__WINESRC__)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
+add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-
spec2def(pdh.dll pdh.spec ADD_IMPORTLIB)
list(APPEND SOURCE
@@ -15,10 +13,6 @@
add_library(pdh SHARED ${SOURCE})
set_module_type(pdh win32dll)
-
target_link_libraries(pdh wine)
-
add_importlibs(pdh msvcrt kernel32 ntdll)
-
-
add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all)
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] Thu Sep 26 14:04:52 2013
@@ -87,12 +87,17 @@
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
-
- if (fdwReason == DLL_WINE_PREATTACH) return FALSE; /* prefer native version */
-
- if (fdwReason == DLL_PROCESS_ATTACH)
- {
- DisableThreadLibraryCalls( hinstDLL );
+ switch (fdwReason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+ case DLL_PROCESS_DETACH:
+ if (lpvReserved) break;
+ DeleteCriticalSection(&pdh_handle_cs);
+ break;
}
return TRUE;
@@ -218,14 +223,27 @@
{ 674, path_uptime, collect_uptime, TYPE_UPTIME,
-3, 1000 }
};
+static BOOL is_local_machine( const WCHAR *name, DWORD len )
+{
+ WCHAR buf[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD buflen = sizeof(buf) / sizeof(buf[0]);
+
+ if (!GetComputerNameW( buf, &buflen )) return FALSE;
+ return len == buflen && !memicmpW( name, buf, buflen );
+}
+
static BOOL pdh_match_path( LPCWSTR fullpath, LPCWSTR path )
{
const WCHAR *p;
- if (strchrW( path, '\\')) p = fullpath;
+ if (path[0] == '\\' && path[1] == '\\' && (p =
strchrW( path + 2, '\\' )) &&
+ is_local_machine( path + 2, p - path - 2 ))
+ {
+ path += p - path;
+ }
+ if (strchrW( path, '\\' )) p = fullpath;
else p = strrchrW( fullpath, '\\' ) + 1;
- if (strcmpW( p, path )) return FALSE;
- return TRUE;
+ return !strcmpW( p, path );
}
/***********************************************************************
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Sep 26 14:04:52 2013
@@ -150,7 +150,7 @@
reactos/dll/win32/olepro32 # Synced to Wine-1.7.1
reactos/dll/win32/olesvr32 # Synced to Wine-1.5.19
reactos/dll/win32/olethk32 # Synced to Wine-1.5.19
-reactos/dll/win32/pdh # Autosync
+reactos/dll/win32/pdh # Synced to Wine-1.7.1
reactos/dll/win32/pidgen # Synced to Wine-1.5.19
reactos/dll/win32/powrprof # Forked at Wine-1.0rc5
reactos/dll/win32/printui # Synced to Wine-1.5.4