OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sandbox/win/src/interceptors_64.h" | 5 #include "sandbox/win/src/interceptors_64.h" |
6 | 6 |
7 #include "sandbox/win/src/interceptors.h" | 7 #include "sandbox/win/src/interceptors.h" |
8 #include "sandbox/win/src/filesystem_interception.h" | 8 #include "sandbox/win/src/filesystem_interception.h" |
9 #include "sandbox/win/src/named_pipe_interception.h" | 9 #include "sandbox/win/src/named_pipe_interception.h" |
10 #include "sandbox/win/src/policy_target.h" | 10 #include "sandbox/win/src/policy_target.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 return TargetGetStockObject(orig_fn, object); | 282 return TargetGetStockObject(orig_fn, object); |
283 } | 283 } |
284 | 284 |
285 SANDBOX_INTERCEPT ATOM WINAPI TargetRegisterClassW64( | 285 SANDBOX_INTERCEPT ATOM WINAPI TargetRegisterClassW64( |
286 const WNDCLASS* wnd_class) { | 286 const WNDCLASS* wnd_class) { |
287 RegisterClassWFunction orig_fn = reinterpret_cast< | 287 RegisterClassWFunction orig_fn = reinterpret_cast< |
288 RegisterClassWFunction>(g_originals[REGISTERCLASSW_ID]); | 288 RegisterClassWFunction>(g_originals[REGISTERCLASSW_ID]); |
289 return TargetRegisterClassW(orig_fn, wnd_class); | 289 return TargetRegisterClassW(orig_fn, wnd_class); |
290 } | 290 } |
291 | 291 |
| 292 SANDBOX_INTERCEPT BOOL WINAPI |
| 293 TargetEnumDisplayMonitors64(HDC hdc, |
| 294 LPCRECT clip_rect, |
| 295 MONITORENUMPROC enum_function, |
| 296 LPARAM data_pointer) { |
| 297 EnumDisplayMonitorsFunction orig_fn = |
| 298 reinterpret_cast<EnumDisplayMonitorsFunction>( |
| 299 g_originals[ENUMDISPLAYMONITORS_ID]); |
| 300 return TargetEnumDisplayMonitors(orig_fn, hdc, clip_rect, enum_function, |
| 301 data_pointer); |
| 302 } |
| 303 |
| 304 SANDBOX_INTERCEPT BOOL WINAPI |
| 305 TargetEnumDisplayDevicesA64(LPCSTR device, |
| 306 DWORD device_num, |
| 307 PDISPLAY_DEVICEA display_device, |
| 308 DWORD flags) { |
| 309 EnumDisplayDevicesAFunction orig_fn = |
| 310 reinterpret_cast<EnumDisplayDevicesAFunction>( |
| 311 g_originals[ENUMDISPLAYDEVICESA_ID]); |
| 312 return TargetEnumDisplayDevicesA(orig_fn, device, device_num, display_device, |
| 313 flags); |
| 314 } |
| 315 |
| 316 SANDBOX_INTERCEPT BOOL WINAPI |
| 317 TargetGetMonitorInfoA64(HMONITOR monitor, LPMONITORINFO monitor_info) { |
| 318 GetMonitorInfoFunction orig_fn = |
| 319 reinterpret_cast<GetMonitorInfoFunction>(g_originals[GETMONITORINFOA_ID]); |
| 320 return TargetGetMonitorInfoA(orig_fn, monitor, monitor_info); |
| 321 } |
| 322 |
| 323 SANDBOX_INTERCEPT BOOL WINAPI |
| 324 TargetGetMonitorInfoW64(HMONITOR monitor, LPMONITORINFO monitor_info) { |
| 325 GetMonitorInfoFunction orig_fn = |
| 326 reinterpret_cast<GetMonitorInfoFunction>(g_originals[GETMONITORINFOW_ID]); |
| 327 return TargetGetMonitorInfoW(orig_fn, monitor, monitor_info); |
| 328 } |
| 329 |
| 330 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 331 TargetGetSuggestedOPMProtectedOutputArraySize64( |
| 332 PUNICODE_STRING device_name, |
| 333 DWORD* suggested_output_array_size) { |
| 334 GetSuggestedOPMProtectedOutputArraySizeFunction orig_fn = |
| 335 reinterpret_cast<GetSuggestedOPMProtectedOutputArraySizeFunction>( |
| 336 g_originals[GETSUGGESTEDOPMPROTECTEDOUTPUTARRAYSIZE_ID]); |
| 337 return TargetGetSuggestedOPMProtectedOutputArraySize( |
| 338 orig_fn, device_name, suggested_output_array_size); |
| 339 } |
| 340 |
| 341 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetCreateOPMProtectedOutputs64( |
| 342 PUNICODE_STRING device_name, |
| 343 DXGKMDT_OPM_VIDEO_OUTPUT_SEMANTICS vos, |
| 344 DWORD protected_output_array_size, |
| 345 DWORD* num_output_handles, |
| 346 OPM_PROTECTED_OUTPUT_HANDLE* protected_output_array) { |
| 347 CreateOPMProtectedOutputsFunction orig_fn = |
| 348 reinterpret_cast<CreateOPMProtectedOutputsFunction>( |
| 349 g_originals[CREATEOPMPROTECTEDOUTPUTS_ID]); |
| 350 return TargetCreateOPMProtectedOutputs( |
| 351 orig_fn, device_name, vos, protected_output_array_size, |
| 352 num_output_handles, protected_output_array); |
| 353 } |
| 354 |
| 355 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 356 TargetGetCertificate64(PUNICODE_STRING device_name, |
| 357 DXGKMDT_CERTIFICATE_TYPE certificate_type, |
| 358 BYTE* certificate, |
| 359 ULONG certificate_length) { |
| 360 GetCertificateFunction orig_fn = |
| 361 reinterpret_cast<GetCertificateFunction>(g_originals[GETCERTIFICATE_ID]); |
| 362 return TargetGetCertificate(orig_fn, device_name, certificate_type, |
| 363 certificate, certificate_length); |
| 364 } |
| 365 |
| 366 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 367 TargetGetCertificateSize64(PUNICODE_STRING device_name, |
| 368 DXGKMDT_CERTIFICATE_TYPE certificate_type, |
| 369 ULONG* certificate_length) { |
| 370 GetCertificateSizeFunction orig_fn = |
| 371 reinterpret_cast<GetCertificateSizeFunction>( |
| 372 g_originals[GETCERTIFICATESIZE_ID]); |
| 373 return TargetGetCertificateSize(orig_fn, device_name, certificate_type, |
| 374 certificate_length); |
| 375 } |
| 376 |
| 377 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetDestroyOPMProtectedOutput64( |
| 378 OPM_PROTECTED_OUTPUT_HANDLE protected_output) { |
| 379 DestroyOPMProtectedOutputFunction orig_fn = |
| 380 reinterpret_cast<DestroyOPMProtectedOutputFunction>( |
| 381 g_originals[DESTROYOPMPROTECTEDOUTPUT_ID]); |
| 382 return TargetDestroyOPMProtectedOutput(orig_fn, protected_output); |
| 383 } |
| 384 |
| 385 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 386 TargetGetOPMInformation64(OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 387 const DXGKMDT_OPM_GET_INFO_PARAMETERS* parameters, |
| 388 DXGKMDT_OPM_REQUESTED_INFORMATION* requested_info) { |
| 389 GetOPMInformationFunction orig_fn = |
| 390 reinterpret_cast<GetOPMInformationFunction>( |
| 391 g_originals[GETOPMINFORMATION_ID]); |
| 392 return TargetGetOPMInformation(orig_fn, protected_output, parameters, |
| 393 requested_info); |
| 394 } |
| 395 |
| 396 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 397 TargetGetOPMRandomNumber64(OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 398 DXGKMDT_OPM_RANDOM_NUMBER* random_number) { |
| 399 GetOPMRandomNumberFunction orig_fn = |
| 400 reinterpret_cast<GetOPMRandomNumberFunction>( |
| 401 g_originals[GETOPMRANDOMNUMBER_ID]); |
| 402 return TargetGetOPMRandomNumber(orig_fn, protected_output, random_number); |
| 403 } |
| 404 |
| 405 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetSetOPMSigningKeyAndSequenceNumbers64( |
| 406 OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 407 const DXGKMDT_OPM_ENCRYPTED_PARAMETERS* parameters) { |
| 408 SetOPMSigningKeyAndSequenceNumbersFunction orig_fn = |
| 409 reinterpret_cast<SetOPMSigningKeyAndSequenceNumbersFunction>( |
| 410 g_originals[SETOPMSIGNINGKEYANDSEQUENCENUMBERS_ID]); |
| 411 return TargetSetOPMSigningKeyAndSequenceNumbers(orig_fn, protected_output, |
| 412 parameters); |
| 413 } |
| 414 |
| 415 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetConfigureOPMProtectedOutput64( |
| 416 OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 417 const DXGKMDT_OPM_CONFIGURE_PARAMETERS* parameters, |
| 418 ULONG additional_parameters_size, |
| 419 const BYTE* additional_parameters) { |
| 420 ConfigureOPMProtectedOutputFunction orig_fn = |
| 421 reinterpret_cast<ConfigureOPMProtectedOutputFunction>( |
| 422 g_originals[CONFIGUREOPMPROTECTEDOUTPUT_ID]); |
| 423 return TargetConfigureOPMProtectedOutput( |
| 424 orig_fn, protected_output, parameters, additional_parameters_size, |
| 425 additional_parameters); |
| 426 } |
| 427 |
292 } // namespace sandbox | 428 } // namespace sandbox |
OLD | NEW |