Chromium Code Reviews| Index: sandbox/win/src/service_resolver_64.cc |
| diff --git a/sandbox/win/src/service_resolver_64.cc b/sandbox/win/src/service_resolver_64.cc |
| index 96124187deb4b383708bca09645f81f3bced75f9..8fd0c0078fba4a35327e2a0e072f27bd05ee09f1 100644 |
| --- a/sandbox/win/src/service_resolver_64.cc |
| +++ b/sandbox/win/src/service_resolver_64.cc |
| @@ -116,6 +116,24 @@ size_t ServiceResolverThunk::GetThunkSize() const { |
| return sizeof(ServiceFullThunk); |
| } |
| +NTSTATUS ServiceResolverThunk::CopyThunk(const void* target_module, |
| + const char* target_name, |
| + BYTE* thunk_storage, |
| + size_t storage_bytes, |
| + size_t* storage_used) { |
| + NTSTATUS ret = ResolveTarget(target_module, target_name, &target_); |
| + if (!NT_SUCCESS(ret)) |
| + return ret; |
| + |
| + size_t thunk_bytes = GetThunkSize(); |
|
robertshield
2014/03/04 01:47:07
Please address Ricardo's note about size checking
Cait (Slow)
2014/03/04 15:43:56
Done.
|
| + ServiceFullThunk* thunk = reinterpret_cast<ServiceFullThunk*>(thunk_storage); |
| + |
| + if (!IsFunctionAService(&thunk->original)) |
| + return STATUS_UNSUCCESSFUL; |
| + |
| + return ret; |
| +} |
| + |
| bool ServiceResolverThunk::IsFunctionAService(void* local_thunk) const { |
| ServiceFullThunk function_code; |
| SIZE_T read; |