-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
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)
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)
+ switch (fdwReason)
{
- DisableThreadLibraryCalls( hinstDLL );
+ 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;
{ 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 );
}
/***********************************************************************
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