Removed PROCESS_IsCurrent().
This commit is contained in:
parent
ea0d028a0b
commit
c2ec36877a
|
@ -157,7 +157,6 @@ extern void ENV_FreeEnvironment( PDB *pdb );
|
||||||
|
|
||||||
/* scheduler/process.c */
|
/* scheduler/process.c */
|
||||||
extern BOOL PROCESS_Init( BOOL win32 );
|
extern BOOL PROCESS_Init( BOOL win32 );
|
||||||
extern BOOL PROCESS_IsCurrent( HANDLE handle );
|
|
||||||
extern PDB *PROCESS_IdToPDB( DWORD id );
|
extern PDB *PROCESS_IdToPDB( DWORD id );
|
||||||
extern void PROCESS_CallUserSignalProc( UINT uCode, DWORD dwThreadId, HMODULE hModule );
|
extern void PROCESS_CallUserSignalProc( UINT uCode, DWORD dwThreadId, HMODULE hModule );
|
||||||
extern PDB *PROCESS_Create( struct _NE_MODULE *pModule, HFILE hFile,
|
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_FreePDB( PDB *pdb );
|
||||||
extern void PROCESS_WalkProcess( void );
|
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)
|
static inline PDB * WINE_UNUSED PROCESS_Current(void)
|
||||||
{
|
{
|
||||||
return NtCurrentTeb()->process;
|
return NtCurrentTeb()->process;
|
||||||
|
|
|
@ -813,7 +813,7 @@ BOOL WINAPI VirtualProtectEx(
|
||||||
DWORD new_prot, /* [in] Desired access protection */
|
DWORD new_prot, /* [in] Desired access protection */
|
||||||
LPDWORD old_prot /* [out] Address of variable to get old 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 );
|
return VirtualProtect( addr, size, new_prot, old_prot );
|
||||||
ERR("Unsupported on other process\n");
|
ERR("Unsupported on other process\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -902,7 +902,7 @@ DWORD WINAPI VirtualQueryEx(
|
||||||
LPMEMORY_BASIC_INFORMATION info, /* [out] Address of info buffer */
|
LPMEMORY_BASIC_INFORMATION info, /* [out] Address of info buffer */
|
||||||
DWORD len /* [in] Size of buffer */ )
|
DWORD len /* [in] Size of buffer */ )
|
||||||
{
|
{
|
||||||
if (PROCESS_IsCurrent( handle ))
|
if (MapProcessHandle( handle ) == GetCurrentProcessId())
|
||||||
return VirtualQuery( addr, info, len );
|
return VirtualQuery( addr, info, len );
|
||||||
ERR("Unsupported on other process\n");
|
ERR("Unsupported on other process\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -63,19 +63,6 @@ void PROCESS_WalkProcess(void)
|
||||||
return;
|
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
|
* PROCESS_IdToPDB
|
||||||
|
@ -274,7 +261,7 @@ void PROCESS_FreePDB( PDB *pdb )
|
||||||
ENV_FreeEnvironment( pdb );
|
ENV_FreeEnvironment( pdb );
|
||||||
while (*pptr && (*pptr != pdb)) pptr = &(*pptr)->next;
|
while (*pptr && (*pptr != pdb)) pptr = &(*pptr)->next;
|
||||||
if (*pptr) *pptr = pdb->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 )
|
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;
|
if (!pdb) return NULL;
|
||||||
pdb->exit_code = STILL_ACTIVE;
|
pdb->exit_code = STILL_ACTIVE;
|
||||||
|
|
Loading…
Reference in New Issue