|
1 | | -/* |
2 | | - * Memory DLL loading code |
3 | | - * Version 0.0.4 |
4 | | - * |
5 | | - * Copyright (c) 2004-2015 by Joachim Bauch / mail@joachim-bauch.de |
6 | | - * http://www.joachim-bauch.de |
7 | | - * |
8 | | - * The contents of this file are subject to the Mozilla Public License Version |
9 | | - * 2.0 (the "License"); you may not use this file except in compliance with |
10 | | - * the License. You may obtain a copy of the License at |
11 | | - * http://www.mozilla.org/MPL/ |
12 | | - * |
13 | | - * Software distributed under the License is distributed on an "AS IS" basis, |
14 | | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
15 | | - * for the specific language governing rights and limitations under the |
16 | | - * License. |
17 | | - * |
18 | | - * The Original Code is MemoryModule.h |
19 | | - * |
20 | | - * The Initial Developer of the Original Code is Joachim Bauch. |
21 | | - * |
22 | | - * Portions created by Joachim Bauch are Copyright (C) 2004-2015 |
23 | | - * Joachim Bauch. All Rights Reserved. |
24 | | - * |
25 | | - */ |
26 | | - |
27 | 1 | #ifndef __MEMORY_MODULE_HEADER |
28 | 2 | #define __MEMORY_MODULE_HEADER |
29 | 3 |
|
| 4 | +#include "stdafx.h" |
30 | 5 | #include <windows.h> |
31 | 6 |
|
32 | 7 | typedef void *HMEMORYMODULE; |
33 | | - |
34 | 8 | typedef void *HMEMORYRSRC; |
35 | | - |
36 | 9 | typedef void *HCUSTOMMODULE; |
37 | 10 |
|
38 | 11 | #ifdef __cplusplus |
39 | 12 | extern "C" { |
40 | 13 | #endif |
41 | 14 |
|
| 15 | +typedef struct |
| 16 | +{ |
| 17 | + void* EntryPoint; |
| 18 | + wchar_t* CommandLine; |
| 19 | + bool InThread; |
| 20 | + void* _ModuleHandle; |
| 21 | +} MEMORYMODULE_START_ARGS; |
| 22 | + |
42 | 23 | typedef HCUSTOMMODULE (*CustomLoadLibraryFunc)(LPCSTR, void *); |
43 | 24 | typedef FARPROC (*CustomGetProcAddressFunc)(HCUSTOMMODULE, LPCSTR, void *); |
44 | 25 | typedef void (*CustomFreeLibraryFunc)(HCUSTOMMODULE, void *); |
@@ -85,7 +66,8 @@ void MemoryFreeLibrary(HMEMORYMODULE); |
85 | 66 | * |
86 | 67 | * Returns a negative value if the entry point could not be executed. |
87 | 68 | */ |
88 | | -int MemoryCallEntryPoint(HMEMORYMODULE); |
| 69 | +int MemoryCallEntryPoint(HMEMORYMODULE, MEMORYMODULE_START_ARGS*); |
| 70 | + |
89 | 71 |
|
90 | 72 | /** |
91 | 73 | * Find the location of a resource with the specified type and name. |
@@ -140,9 +122,10 @@ FARPROC MemoryDefaultGetProcAddress(HCUSTOMMODULE, LPCSTR, void *); |
140 | 122 | * This is the default as used by MemoryLoadLibrary. |
141 | 123 | */ |
142 | 124 | void MemoryDefaultFreeLibrary(HCUSTOMMODULE, void *); |
| 125 | +void MemoryModuleExecuteCode(MEMORYMODULE_START_ARGS*); |
143 | 126 |
|
144 | 127 | #ifdef __cplusplus |
145 | 128 | } |
146 | 129 | #endif |
147 | 130 |
|
148 | | -#endif // __MEMORY_MODULE_HEADER |
| 131 | +#endif |
0 commit comments