Skip to content

Commit 5161941

Browse files
committed
added support for runtime arguments
1 parent d197073 commit 5161941

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

MemoryModule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ static void _FreeLibrary(HCUSTOMMODULE module, void *userdata)
428428
FreeLibrary((HMODULE) module);
429429
}
430430

431-
HMEMORYMODULE MemoryLoadLibrary(const void *data)
431+
HMEMORYMODULE MemoryLoadLibrary(const void *data, const char * argv[])
432432
{
433-
return MemoryLoadLibraryEx(data, _LoadLibrary, _GetProcAddress, _FreeLibrary, NULL);
433+
return MemoryLoadLibraryEx(data, _LoadLibrary, _GetProcAddress, _FreeLibrary, argv);
434434
}
435435

436436
HMEMORYMODULE MemoryLoadLibraryEx(const void *data,

MemoryModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef void (*CustomFreeLibraryFunc)(HCUSTOMMODULE, void *);
4949
* All dependencies are resolved using default LoadLibrary/GetProcAddress
5050
* calls through the Windows API.
5151
*/
52-
HMEMORYMODULE MemoryLoadLibrary(const void *);
52+
HMEMORYMODULE MemoryLoadLibrary(const void *, const char *[]);
5353

5454
/**
5555
* Load EXE/DLL from memory location using custom dependency resolvers.

example/DllLoader/DllLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void LoadFromMemory(void)
6868
fread(data, 1, size, fp);
6969
fclose(fp);
7070

71-
handle = MemoryLoadLibrary(data);
71+
handle = MemoryLoadLibrary(data, NULL);
7272
if (handle == NULL)
7373
{
7474
_tprintf(_T("Can't load library from memory.\n"));

example/DllLoader/DllLoaderLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int RunFromMemory(void)
3131
fread(data, 1, size, fp);
3232
fclose(fp);
3333

34-
handle = MemoryLoadLibrary(data);
34+
handle = MemoryLoadLibrary(data, NULL);
3535
if (handle == NULL)
3636
{
3737
_tprintf(_T("Can't load library from memory.\n"));

0 commit comments

Comments
 (0)