-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHighLevelDLLFunction.h
More file actions
62 lines (50 loc) · 1.52 KB
/
HighLevelDLLFunction.h
File metadata and controls
62 lines (50 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//---------------------------------------------------------------------------
#ifndef HighLevelDLLFunctionH
#define HighLevelDLLFunctionH
#include "CallDLLInterfaceFunction.h"
#include "LowLevelDLLFunction.h"
namespace CallDLLInterface
{
class HashedLibraries;
class HighLevelDLLFunction
{
public:
std::string filename;
std::string function;
HashedLibraries* pHashedLibs;
//*Constructors
HighLevelDLLFunction(std::string file = "", std::string func = "", HashedLibraries* pHshLibs = NULL)
: filename(file), function(func), pHashedLibs(pHshLibs){ }
private:
//used hashed library if we can
HANDLE LoadLibraryToHandle() const
{
if (pHashedLibs != NULL)
{
return NULL; //pHashedLibs->LoadHashedLibrary(filename);
}
else
{
return LoadLibrary(filename.c_str());
}
}
public:
bool toLowLevel(HANDLE& h, FARPROC& f)
{
h = this->LoadLibraryToHandle();
f = GetProcAddress(h, function.c_str());
return (h && f);
}
/**
LowLevelDLLFunction toLowLevel() const
{
LowLevelDLLFunction lowDLLfunc;
lowDLLfunc.handle = this->LoadLibraryToHandle();
lowDLLfunc.farproc = GetProcAddress(lowDLLfunc.handle, function.c_str());
return lowDLLfunc;
}
**/
};
};//end namespace
//---------------------------------------------------------------------------
#endif