mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:53:00 +00:00
[PDH]
* Sync with Wine 1.7.1. CORE-7469 svn path=/trunk/; revision=60360
This commit is contained in:
parent
f233ce7bef
commit
9b96b235a8
3 changed files with 28 additions and 16 deletions
|
@ -1,11 +1,9 @@
|
||||||
|
|
||||||
add_definitions(-D__WINESRC__)
|
|
||||||
|
|
||||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||||
add_definitions(-D_WIN32_WINNT=0x600)
|
add_definitions(-D_WIN32_WINNT=0x600)
|
||||||
|
|
||||||
|
add_definitions(-D__WINESRC__)
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||||
|
|
||||||
spec2def(pdh.dll pdh.spec ADD_IMPORTLIB)
|
spec2def(pdh.dll pdh.spec ADD_IMPORTLIB)
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
|
@ -15,10 +13,6 @@ list(APPEND SOURCE
|
||||||
|
|
||||||
add_library(pdh SHARED ${SOURCE})
|
add_library(pdh SHARED ${SOURCE})
|
||||||
set_module_type(pdh win32dll)
|
set_module_type(pdh win32dll)
|
||||||
|
|
||||||
target_link_libraries(pdh wine)
|
target_link_libraries(pdh wine)
|
||||||
|
|
||||||
add_importlibs(pdh msvcrt kernel32 ntdll)
|
add_importlibs(pdh msvcrt kernel32 ntdll)
|
||||||
|
|
||||||
|
|
||||||
add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -87,12 +87,17 @@ static inline WCHAR *pdh_strdup_aw( const char *src )
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
{
|
{
|
||||||
TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
|
TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
|
||||||
|
switch (fdwReason)
|
||||||
if (fdwReason == DLL_WINE_PREATTACH) return FALSE; /* prefer native version */
|
|
||||||
|
|
||||||
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
||||||
{
|
{
|
||||||
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;
|
return TRUE;
|
||||||
|
@ -218,14 +223,27 @@ static const struct source counter_sources[] =
|
||||||
{ 674, path_uptime, collect_uptime, TYPE_UPTIME, -3, 1000 }
|
{ 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 )
|
static BOOL pdh_match_path( LPCWSTR fullpath, LPCWSTR path )
|
||||||
{
|
{
|
||||||
const WCHAR *p;
|
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;
|
else p = strrchrW( fullpath, '\\' ) + 1;
|
||||||
if (strcmpW( p, path )) return FALSE;
|
return !strcmpW( p, path );
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -150,7 +150,7 @@ reactos/dll/win32/oledlg # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/olepro32 # Synced to Wine-1.7.1
|
reactos/dll/win32/olepro32 # Synced to Wine-1.7.1
|
||||||
reactos/dll/win32/olesvr32 # Synced to Wine-1.5.19
|
reactos/dll/win32/olesvr32 # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/olethk32 # 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/pidgen # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/powrprof # Forked at Wine-1.0rc5
|
reactos/dll/win32/powrprof # Forked at Wine-1.0rc5
|
||||||
reactos/dll/win32/printui # Synced to Wine-1.5.4
|
reactos/dll/win32/printui # Synced to Wine-1.5.4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue