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 GetMonitorInfoAFunction orig_fn = reinterpret_cast<GetMonitorInfoAFunction>( |
| 319 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 GetMonitorInfoWFunction orig_fn = reinterpret_cast<GetMonitorInfoWFunction>( |
| 326 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 |
| 378 TargetGetCertificateByHandle64(OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 379 DXGKMDT_CERTIFICATE_TYPE certificate_type, |
| 380 BYTE* certificate, |
| 381 ULONG certificate_length) { |
| 382 GetCertificateByHandleFunction orig_fn = |
| 383 reinterpret_cast<GetCertificateByHandleFunction>( |
| 384 g_originals[GETCERTIFICATE_ID]); |
| 385 return TargetGetCertificateByHandle(orig_fn, protected_output, |
| 386 certificate_type, certificate, |
| 387 certificate_length); |
| 388 } |
| 389 |
| 390 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 391 TargetGetCertificateSizeByHandle64( |
| 392 OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 393 DXGKMDT_CERTIFICATE_TYPE certificate_type, |
| 394 ULONG* certificate_length) { |
| 395 GetCertificateSizeByHandleFunction orig_fn = |
| 396 reinterpret_cast<GetCertificateSizeByHandleFunction>( |
| 397 g_originals[GETCERTIFICATESIZE_ID]); |
| 398 return TargetGetCertificateSizeByHandle(orig_fn, protected_output, |
| 399 certificate_type, certificate_length); |
| 400 } |
| 401 |
| 402 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetDestroyOPMProtectedOutput64( |
| 403 OPM_PROTECTED_OUTPUT_HANDLE protected_output) { |
| 404 DestroyOPMProtectedOutputFunction orig_fn = |
| 405 reinterpret_cast<DestroyOPMProtectedOutputFunction>( |
| 406 g_originals[DESTROYOPMPROTECTEDOUTPUT_ID]); |
| 407 return TargetDestroyOPMProtectedOutput(orig_fn, protected_output); |
| 408 } |
| 409 |
| 410 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 411 TargetGetOPMInformation64(OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 412 const DXGKMDT_OPM_GET_INFO_PARAMETERS* parameters, |
| 413 DXGKMDT_OPM_REQUESTED_INFORMATION* requested_info) { |
| 414 GetOPMInformationFunction orig_fn = |
| 415 reinterpret_cast<GetOPMInformationFunction>( |
| 416 g_originals[GETOPMINFORMATION_ID]); |
| 417 return TargetGetOPMInformation(orig_fn, protected_output, parameters, |
| 418 requested_info); |
| 419 } |
| 420 |
| 421 SANDBOX_INTERCEPT NTSTATUS WINAPI |
| 422 TargetGetOPMRandomNumber64(OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 423 DXGKMDT_OPM_RANDOM_NUMBER* random_number) { |
| 424 GetOPMRandomNumberFunction orig_fn = |
| 425 reinterpret_cast<GetOPMRandomNumberFunction>( |
| 426 g_originals[GETOPMRANDOMNUMBER_ID]); |
| 427 return TargetGetOPMRandomNumber(orig_fn, protected_output, random_number); |
| 428 } |
| 429 |
| 430 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetSetOPMSigningKeyAndSequenceNumbers64( |
| 431 OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 432 const DXGKMDT_OPM_ENCRYPTED_PARAMETERS* parameters) { |
| 433 SetOPMSigningKeyAndSequenceNumbersFunction orig_fn = |
| 434 reinterpret_cast<SetOPMSigningKeyAndSequenceNumbersFunction>( |
| 435 g_originals[SETOPMSIGNINGKEYANDSEQUENCENUMBERS_ID]); |
| 436 return TargetSetOPMSigningKeyAndSequenceNumbers(orig_fn, protected_output, |
| 437 parameters); |
| 438 } |
| 439 |
| 440 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetConfigureOPMProtectedOutput64( |
| 441 OPM_PROTECTED_OUTPUT_HANDLE protected_output, |
| 442 const DXGKMDT_OPM_CONFIGURE_PARAMETERS* parameters, |
| 443 ULONG additional_parameters_size, |
| 444 const BYTE* additional_parameters) { |
| 445 ConfigureOPMProtectedOutputFunction orig_fn = |
| 446 reinterpret_cast<ConfigureOPMProtectedOutputFunction>( |
| 447 g_originals[CONFIGUREOPMPROTECTEDOUTPUT_ID]); |
| 448 return TargetConfigureOPMProtectedOutput( |
| 449 orig_fn, protected_output, parameters, additional_parameters_size, |
| 450 additional_parameters); |
| 451 } |
| 452 |
292 } // namespace sandbox | 453 } // namespace sandbox |
OLD | NEW |