Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: sandbox/win/src/interceptors_64.cc

Issue 1856993003: Implement sandbox hooks to forward OPM related GDI system calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed header Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/interceptors_64.h ('k') | sandbox/win/src/ipc_tags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/interceptors_64.cc
diff --git a/sandbox/win/src/interceptors_64.cc b/sandbox/win/src/interceptors_64.cc
index a9b38b69ddfa2ab773f9505db87b348e1c800886..0e9142467a899e7b5713c687e9127c1b1b4d3985 100644
--- a/sandbox/win/src/interceptors_64.cc
+++ b/sandbox/win/src/interceptors_64.cc
@@ -289,4 +289,165 @@ SANDBOX_INTERCEPT ATOM WINAPI TargetRegisterClassW64(
return TargetRegisterClassW(orig_fn, wnd_class);
}
+SANDBOX_INTERCEPT BOOL WINAPI
+TargetEnumDisplayMonitors64(HDC hdc,
+ LPCRECT clip_rect,
+ MONITORENUMPROC enum_function,
+ LPARAM data_pointer) {
+ EnumDisplayMonitorsFunction orig_fn =
+ reinterpret_cast<EnumDisplayMonitorsFunction>(
+ g_originals[ENUMDISPLAYMONITORS_ID]);
+ return TargetEnumDisplayMonitors(orig_fn, hdc, clip_rect, enum_function,
+ data_pointer);
+}
+
+SANDBOX_INTERCEPT BOOL WINAPI
+TargetEnumDisplayDevicesA64(LPCSTR device,
+ DWORD device_num,
+ PDISPLAY_DEVICEA display_device,
+ DWORD flags) {
+ EnumDisplayDevicesAFunction orig_fn =
+ reinterpret_cast<EnumDisplayDevicesAFunction>(
+ g_originals[ENUMDISPLAYDEVICESA_ID]);
+ return TargetEnumDisplayDevicesA(orig_fn, device, device_num, display_device,
+ flags);
+}
+
+SANDBOX_INTERCEPT BOOL WINAPI
+TargetGetMonitorInfoA64(HMONITOR monitor, LPMONITORINFO monitor_info) {
+ GetMonitorInfoAFunction orig_fn = reinterpret_cast<GetMonitorInfoAFunction>(
+ g_originals[GETMONITORINFOA_ID]);
+ return TargetGetMonitorInfoA(orig_fn, monitor, monitor_info);
+}
+
+SANDBOX_INTERCEPT BOOL WINAPI
+TargetGetMonitorInfoW64(HMONITOR monitor, LPMONITORINFO monitor_info) {
+ GetMonitorInfoWFunction orig_fn = reinterpret_cast<GetMonitorInfoWFunction>(
+ g_originals[GETMONITORINFOW_ID]);
+ return TargetGetMonitorInfoW(orig_fn, monitor, monitor_info);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetSuggestedOPMProtectedOutputArraySize64(
+ PUNICODE_STRING device_name,
+ DWORD* suggested_output_array_size) {
+ GetSuggestedOPMProtectedOutputArraySizeFunction orig_fn =
+ reinterpret_cast<GetSuggestedOPMProtectedOutputArraySizeFunction>(
+ g_originals[GETSUGGESTEDOPMPROTECTEDOUTPUTARRAYSIZE_ID]);
+ return TargetGetSuggestedOPMProtectedOutputArraySize(
+ orig_fn, device_name, suggested_output_array_size);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI TargetCreateOPMProtectedOutputs64(
+ PUNICODE_STRING device_name,
+ DXGKMDT_OPM_VIDEO_OUTPUT_SEMANTICS vos,
+ DWORD protected_output_array_size,
+ DWORD* num_output_handles,
+ OPM_PROTECTED_OUTPUT_HANDLE* protected_output_array) {
+ CreateOPMProtectedOutputsFunction orig_fn =
+ reinterpret_cast<CreateOPMProtectedOutputsFunction>(
+ g_originals[CREATEOPMPROTECTEDOUTPUTS_ID]);
+ return TargetCreateOPMProtectedOutputs(
+ orig_fn, device_name, vos, protected_output_array_size,
+ num_output_handles, protected_output_array);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetCertificate64(PUNICODE_STRING device_name,
+ DXGKMDT_CERTIFICATE_TYPE certificate_type,
+ BYTE* certificate,
+ ULONG certificate_length) {
+ GetCertificateFunction orig_fn =
+ reinterpret_cast<GetCertificateFunction>(g_originals[GETCERTIFICATE_ID]);
+ return TargetGetCertificate(orig_fn, device_name, certificate_type,
+ certificate, certificate_length);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetCertificateSize64(PUNICODE_STRING device_name,
+ DXGKMDT_CERTIFICATE_TYPE certificate_type,
+ ULONG* certificate_length) {
+ GetCertificateSizeFunction orig_fn =
+ reinterpret_cast<GetCertificateSizeFunction>(
+ g_originals[GETCERTIFICATESIZE_ID]);
+ return TargetGetCertificateSize(orig_fn, device_name, certificate_type,
+ certificate_length);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetCertificateByHandle64(OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ DXGKMDT_CERTIFICATE_TYPE certificate_type,
+ BYTE* certificate,
+ ULONG certificate_length) {
+ GetCertificateByHandleFunction orig_fn =
+ reinterpret_cast<GetCertificateByHandleFunction>(
+ g_originals[GETCERTIFICATE_ID]);
+ return TargetGetCertificateByHandle(orig_fn, protected_output,
+ certificate_type, certificate,
+ certificate_length);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetCertificateSizeByHandle64(
+ OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ DXGKMDT_CERTIFICATE_TYPE certificate_type,
+ ULONG* certificate_length) {
+ GetCertificateSizeByHandleFunction orig_fn =
+ reinterpret_cast<GetCertificateSizeByHandleFunction>(
+ g_originals[GETCERTIFICATESIZE_ID]);
+ return TargetGetCertificateSizeByHandle(orig_fn, protected_output,
+ certificate_type, certificate_length);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI TargetDestroyOPMProtectedOutput64(
+ OPM_PROTECTED_OUTPUT_HANDLE protected_output) {
+ DestroyOPMProtectedOutputFunction orig_fn =
+ reinterpret_cast<DestroyOPMProtectedOutputFunction>(
+ g_originals[DESTROYOPMPROTECTEDOUTPUT_ID]);
+ return TargetDestroyOPMProtectedOutput(orig_fn, protected_output);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetOPMInformation64(OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ const DXGKMDT_OPM_GET_INFO_PARAMETERS* parameters,
+ DXGKMDT_OPM_REQUESTED_INFORMATION* requested_info) {
+ GetOPMInformationFunction orig_fn =
+ reinterpret_cast<GetOPMInformationFunction>(
+ g_originals[GETOPMINFORMATION_ID]);
+ return TargetGetOPMInformation(orig_fn, protected_output, parameters,
+ requested_info);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI
+TargetGetOPMRandomNumber64(OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ DXGKMDT_OPM_RANDOM_NUMBER* random_number) {
+ GetOPMRandomNumberFunction orig_fn =
+ reinterpret_cast<GetOPMRandomNumberFunction>(
+ g_originals[GETOPMRANDOMNUMBER_ID]);
+ return TargetGetOPMRandomNumber(orig_fn, protected_output, random_number);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI TargetSetOPMSigningKeyAndSequenceNumbers64(
+ OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ const DXGKMDT_OPM_ENCRYPTED_PARAMETERS* parameters) {
+ SetOPMSigningKeyAndSequenceNumbersFunction orig_fn =
+ reinterpret_cast<SetOPMSigningKeyAndSequenceNumbersFunction>(
+ g_originals[SETOPMSIGNINGKEYANDSEQUENCENUMBERS_ID]);
+ return TargetSetOPMSigningKeyAndSequenceNumbers(orig_fn, protected_output,
+ parameters);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI TargetConfigureOPMProtectedOutput64(
+ OPM_PROTECTED_OUTPUT_HANDLE protected_output,
+ const DXGKMDT_OPM_CONFIGURE_PARAMETERS* parameters,
+ ULONG additional_parameters_size,
+ const BYTE* additional_parameters) {
+ ConfigureOPMProtectedOutputFunction orig_fn =
+ reinterpret_cast<ConfigureOPMProtectedOutputFunction>(
+ g_originals[CONFIGUREOPMPROTECTEDOUTPUT_ID]);
+ return TargetConfigureOPMProtectedOutput(
+ orig_fn, protected_output, parameters, additional_parameters_size,
+ additional_parameters);
+}
+
} // namespace sandbox
« no previous file with comments | « sandbox/win/src/interceptors_64.h ('k') | sandbox/win/src/ipc_tags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698