security/sandbox/win/src/process_thread_interception.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright (c) 2006-2011 The Chromium Authors. All rights reserved.
     2 // Use of this source code is governed by a BSD-style license that can be
     3 // found in the LICENSE file.
     5 #include "sandbox/win/src/nt_internals.h"
     6 #include "sandbox/win/src/sandbox_types.h"
     8 #ifndef SANDBOX_SRC_PROCESS_THREAD_INTERCEPTION_H__
     9 #define SANDBOX_SRC_PROCESS_THREAD_INTERCEPTION_H__
    11 namespace sandbox {
    13 extern "C" {
    15 typedef BOOL (WINAPI *CreateProcessWFunction)(
    16     LPCWSTR lpApplicationName,
    17     LPWSTR lpCommandLine,
    18     LPSECURITY_ATTRIBUTES lpProcessAttributes,
    19     LPSECURITY_ATTRIBUTES lpThreadAttributes,
    20     BOOL bInheritHandles,
    21     DWORD dwCreationFlags,
    22     LPVOID lpEnvironment,
    23     LPCWSTR lpCurrentDirectory,
    24     LPSTARTUPINFOW lpStartupInfo,
    25     LPPROCESS_INFORMATION lpProcessInformation);
    27 typedef BOOL (WINAPI *CreateProcessAFunction)(
    28     LPCSTR lpApplicationName,
    29     LPSTR lpCommandLine,
    30     LPSECURITY_ATTRIBUTES lpProcessAttributes,
    31     LPSECURITY_ATTRIBUTES lpThreadAttributes,
    32     BOOL bInheritHandles,
    33     DWORD dwCreationFlags,
    34     LPVOID lpEnvironment,
    35     LPCSTR lpCurrentDirectory,
    36     LPSTARTUPINFOA lpStartupInfo,
    37     LPPROCESS_INFORMATION lpProcessInformation);
    39 typedef HANDLE (WINAPI *CreateThreadFunction)(
    40     LPSECURITY_ATTRIBUTES lpThreadAttributes,
    41     SIZE_T dwStackSize,
    42     LPTHREAD_START_ROUTINE lpStartAddress,
    43     PVOID lpParameter,
    44     DWORD dwCreationFlags,
    45     LPDWORD lpThreadId);
    47 typedef LCID (WINAPI *GetUserDefaultLCIDFunction)();
    49 // Interception of NtOpenThread on the child process.
    50 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenThread(
    51     NtOpenThreadFunction orig_OpenThread, PHANDLE thread,
    52     ACCESS_MASK desired_access, POBJECT_ATTRIBUTES object_attributes,
    53     PCLIENT_ID client_id);
    55 // Interception of NtOpenProcess on the child process.
    56 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenProcess(
    57     NtOpenProcessFunction orig_OpenProcess, PHANDLE process,
    58     ACCESS_MASK desired_access, POBJECT_ATTRIBUTES object_attributes,
    59     PCLIENT_ID client_id);
    61 // Interception of NtOpenProcessToken on the child process.
    62 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenProcessToken(
    63     NtOpenProcessTokenFunction orig_OpenProcessToken, HANDLE process,
    64     ACCESS_MASK desired_access, PHANDLE token);
    66 // Interception of NtOpenProcessTokenEx on the child process.
    67 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenProcessTokenEx(
    68     NtOpenProcessTokenExFunction orig_OpenProcessTokenEx, HANDLE process,
    69     ACCESS_MASK desired_access, ULONG handle_attributes, PHANDLE token);
    71 // Interception of CreateProcessW and A in kernel32.dll.
    72 SANDBOX_INTERCEPT BOOL WINAPI TargetCreateProcessW(
    73     CreateProcessWFunction orig_CreateProcessW, LPCWSTR application_name,
    74     LPWSTR command_line, LPSECURITY_ATTRIBUTES process_attributes,
    75     LPSECURITY_ATTRIBUTES thread_attributes, BOOL inherit_handles, DWORD flags,
    76     LPVOID environment, LPCWSTR current_directory, LPSTARTUPINFOW startup_info,
    77     LPPROCESS_INFORMATION process_information);
    79 SANDBOX_INTERCEPT BOOL WINAPI TargetCreateProcessA(
    80     CreateProcessAFunction orig_CreateProcessA, LPCSTR application_name,
    81     LPSTR command_line, LPSECURITY_ATTRIBUTES process_attributes,
    82     LPSECURITY_ATTRIBUTES thread_attributes, BOOL inherit_handles, DWORD flags,
    83     LPVOID environment, LPCSTR current_directory, LPSTARTUPINFOA startup_info,
    84     LPPROCESS_INFORMATION process_information);
    86 // Interception of CreateThread in kernel32.dll.
    87 SANDBOX_INTERCEPT HANDLE WINAPI TargetCreateThread(
    88     CreateThreadFunction orig_CreateThread,
    89     LPSECURITY_ATTRIBUTES thread_attributes, SIZE_T stack_size,
    90     LPTHREAD_START_ROUTINE start_address, PVOID parameter,
    91     DWORD creation_flags, LPDWORD thread_id);
    93 // Interception of GetUserDefaultLCID in kernel32.dll.
    94 SANDBOX_INTERCEPT LCID WINAPI TargetGetUserDefaultLCID(
    95     GetUserDefaultLCIDFunction orig_GetUserDefaultLCID);
    97 }  // extern "C"
    99 }  // namespace sandbox
   101 #endif  // SANDBOX_SRC_PROCESS_THREAD_INTERCEPTION_H__

mercurial