diff options
Diffstat (limited to 'src/engine/externalengine.cpp')
-rw-r--r-- | src/engine/externalengine.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/engine/externalengine.cpp b/src/engine/externalengine.cpp new file mode 100644 index 00000000..ef4f931d --- /dev/null +++ b/src/engine/externalengine.cpp | |||
@@ -0,0 +1,30 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | #include "precomp.h" | ||
4 | |||
5 | |||
6 | // function definitions | ||
7 | |||
8 | // TODO: callers need to provide the original size (at the time of first public release) of the struct instead of the current size. | ||
9 | HRESULT WINAPI ExternalEngineValidateMessageParameter( | ||
10 | __in_opt const LPVOID pv, | ||
11 | __in SIZE_T cbSizeOffset, | ||
12 | __in DWORD dwMinimumSize | ||
13 | ) | ||
14 | { | ||
15 | HRESULT hr = S_OK; | ||
16 | |||
17 | if (!pv) | ||
18 | { | ||
19 | ExitFunction1(hr = E_INVALIDARG); | ||
20 | } | ||
21 | |||
22 | DWORD cbSize = *(DWORD*)((BYTE*)pv + cbSizeOffset); | ||
23 | if (dwMinimumSize < cbSize) | ||
24 | { | ||
25 | ExitFunction1(hr = E_INVALIDARG); | ||
26 | } | ||
27 | |||
28 | LExit: | ||
29 | return hr; | ||
30 | } | ||