From c2ec36877af11f2c4cc32a907ddac8982e4af9bf Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 10 Mar 2000 22:21:07 +0000 Subject: [PATCH] Removed PROCESS_IsCurrent(). --- include/process.h | 4 ---- memory/virtual.c | 4 ++-- scheduler/process.c | 17 ++--------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/include/process.h b/include/process.h index b32f4c889d3..461e932985d 100644 --- a/include/process.h +++ b/include/process.h @@ -157,7 +157,6 @@ extern void ENV_FreeEnvironment( PDB *pdb ); /* scheduler/process.c */ extern BOOL PROCESS_Init( BOOL win32 ); -extern BOOL PROCESS_IsCurrent( HANDLE handle ); extern PDB *PROCESS_IdToPDB( DWORD id ); extern void PROCESS_CallUserSignalProc( UINT uCode, DWORD dwThreadId, HMODULE hModule ); extern PDB *PROCESS_Create( struct _NE_MODULE *pModule, HFILE hFile, @@ -168,9 +167,6 @@ extern PDB *PROCESS_Create( struct _NE_MODULE *pModule, HFILE hFile, extern void PROCESS_FreePDB( PDB *pdb ); extern void PROCESS_WalkProcess( void ); -/* scheduler/debugger.c */ -extern DWORD DEBUG_SendExceptionEvent( EXCEPTION_RECORD *rec, BOOL first_chance, CONTEXT *ctx ); - static inline PDB * WINE_UNUSED PROCESS_Current(void) { return NtCurrentTeb()->process; diff --git a/memory/virtual.c b/memory/virtual.c index c29c7f51da4..e373ff4544a 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -813,7 +813,7 @@ BOOL WINAPI VirtualProtectEx( DWORD new_prot, /* [in] Desired access protection */ LPDWORD old_prot /* [out] Address of variable to get old protection */ ) { - if (PROCESS_IsCurrent( handle )) + if (MapProcessHandle( handle ) == GetCurrentProcessId()) return VirtualProtect( addr, size, new_prot, old_prot ); ERR("Unsupported on other process\n"); return FALSE; @@ -902,7 +902,7 @@ DWORD WINAPI VirtualQueryEx( LPMEMORY_BASIC_INFORMATION info, /* [out] Address of info buffer */ DWORD len /* [in] Size of buffer */ ) { - if (PROCESS_IsCurrent( handle )) + if (MapProcessHandle( handle ) == GetCurrentProcessId()) return VirtualQuery( addr, info, len ); ERR("Unsupported on other process\n"); return 0; diff --git a/scheduler/process.c b/scheduler/process.c index 98a5ee435e8..ec41917d2e6 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -63,19 +63,6 @@ void PROCESS_WalkProcess(void) return; } -/*********************************************************************** - * PROCESS_IsCurrent - * - * Check if a handle is to the current process - */ -BOOL PROCESS_IsCurrent( HANDLE handle ) -{ - struct get_process_info_request *req = get_req_buffer(); - req->handle = handle; - return (!server_call( REQ_GET_PROCESS_INFO ) && - (req->pid == PROCESS_Current()->server_pid)); -} - /*********************************************************************** * PROCESS_IdToPDB @@ -274,7 +261,7 @@ void PROCESS_FreePDB( PDB *pdb ) ENV_FreeEnvironment( pdb ); while (*pptr && (*pptr != pdb)) pptr = &(*pptr)->next; if (*pptr) *pptr = pdb->next; - HeapFree( SystemHeap, 0, pdb ); + HeapFree( GetProcessHeap(), 0, pdb ); } @@ -286,7 +273,7 @@ void PROCESS_FreePDB( PDB *pdb ) */ static PDB *PROCESS_CreatePDB( PDB *parent, BOOL inherit ) { - PDB *pdb = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, sizeof(PDB) ); + PDB *pdb = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PDB) ); if (!pdb) return NULL; pdb->exit_code = STILL_ACTIVE;