[pywin32-checkins] pywin32/win32/src/PerfMon MappingManager.cpp,1.1,1.2 perfmondata.cpp,1.1,1.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-09-13 01:49:44
|
Update of /cvsroot/pywin32/pywin32/win32/src/PerfMon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26620 Modified Files: MappingManager.cpp perfmondata.cpp Log Message: Patches from Phil Frantz so the perfmon module works in a terminal services environment. Index: MappingManager.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/MappingManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MappingManager.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- MappingManager.cpp 13 Sep 2004 01:49:35 -0000 1.2 *************** *** 42,49 **** --- 42,57 ---- BOOL MappingManager::Init(const TCHAR *szServiceName, const TCHAR *szMappingName /* = NULL */, const TCHAR *szEventSourceName /* = NULL */) { + TCHAR szGlobalMapping[MAX_PATH+10]; + + if (szMappingName==NULL) szMappingName = szServiceName; if (szEventSourceName==NULL) szEventSourceName = szServiceName; + + + _tcscpy(szGlobalMapping, _T("Global\\")); + _tcscat(szGlobalMapping, szMappingName); + m_hMappedObject = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, *************** *** 51,55 **** 0, 4096, ! szMappingName); if (m_hMappedObject == NULL) { PyWin_SetAPIError("CreateFileMapping"); --- 59,63 ---- 0, 4096, ! szGlobalMapping); if (m_hMappedObject == NULL) { PyWin_SetAPIError("CreateFileMapping"); Index: perfmondata.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/perfmondata.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** perfmondata.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- perfmondata.cpp 13 Sep 2004 01:49:35 -0000 1.2 *************** *** 148,151 **** --- 148,156 ---- DWORD type; TCHAR registryKeyName[MAX_PATH]; + TCHAR szFileMapping[MAX_PATH+10]; + + _tcscpy(szFileMapping, _T("Global\\")); + _tcscat(szFileMapping, szModuleName); + // // Since SCREG is multi-threaded and will call this routine in *************** *** 164,168 **** hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, ! szModuleName); pCounterBlock = NULL; --- 169,173 ---- hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, ! szFileMapping); pCounterBlock = NULL; |