Commit 28827eb8 by 李定达

1.支付宝支付界面调用dll

parent 1b2543ef
......@@ -7,6 +7,8 @@
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define SBKPAYDLL "sbkpay.dll"
#define FMPDLL "fmclient.dll"
//#define FMCRYPT "fmcrypt.dll"
#define LIBCURL "libcurl.dll"
......@@ -28,6 +30,7 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase;
void DoCopyFile(const char *dir);
EXTERN_C typedef void (_stdcall *PFN_START)(char *, char *);
EXTERN_C typedef int (_stdcall *PFN_GETVALUE)(char *, char *);
EXTERN_C typedef int (_stdcall *PFN_RESGETVALUE)(char *, char *);
EXTERN_C typedef int (_stdcall *PFN_GETRSACRET)(int ,const char *,const char *);
......@@ -50,11 +53,12 @@ HMODULE GetInstance()
SetCurrentDirectory(mod);
char instance[MAX_PATH] = { 0 };
sprintf(instance, "%s%s", mod, FMPDLL);
if(init_sign == 0)
DoCopyFile(mod);
init_sign = 1;
sprintf(instance, "%s%s", mod, SBKPAYDLL);
//if(init_sign == 0)
// DoCopyFile(mod);
//init_sign = 1;
HMODULE hMod = LoadLibraryA(instance);
//HMODULE hModw = LoadLibraryW(L"C:\\Users\\dingda.li\\Desktop\\sbkpay\\sbkpay.dll");
printf("Changing current to: %s\n", current_dir);
SetCurrentDirectory(current_dir);
......@@ -112,46 +116,60 @@ void DoCopyFile(const char *dir)
extern "C"{
__declspec(dllexport) int _stdcall GetValue(char *indata, char *outdata)
__declspec(dllexport) void _stdcall FreemudPay(char *indata, char *outdata)
{
HMODULE hMod = GetInstance();
if (hMod) {
PFN_GETVALUE pfn_GetValue = (PFN_GETVALUE)GetProcAddress(hMod, "_GetValue@8");
PFN_START pfn_GetValue = (PFN_START)GetProcAddress(hMod, "Start");
if (pfn_GetValue) {
return pfn_GetValue(indata, outdata);
pfn_GetValue(indata, outdata);
return ;
}
FreeLibrary(hMod);
}
return -1;
return ;
}
__declspec(dllexport) int _stdcall RESGetValue(char *indata, char *outdata)
{
HMODULE hMod = GetInstance();
if (hMod) {
PFN_RESGETVALUE pfn_GetValue = (PFN_RESGETVALUE)GetProcAddress(hMod, "RESGetValue");
if (pfn_GetValue) {
return pfn_GetValue(indata, outdata);
}
FreeLibrary(hMod);
}
return -1;
}
__declspec(dllexport) int _stdcall GetRSACret(int partnerId,const char *storeID,const char *posNo)
{
HMODULE hMod = GetInstance();
if (hMod) {
PFN_GETRSACRET pfn_GetValue = (PFN_GETRSACRET)GetProcAddress(hMod, "_GetRSACret@12");
if (pfn_GetValue) {
return pfn_GetValue(partnerId, storeID, posNo);
}
FreeLibrary(hMod);
}
return -1;
}
//__declspec(dllexport) int _stdcall GetValue(char *indata, char *outdata)
//{
// HMODULE hMod = GetInstance();
// if (hMod) {
// PFN_GETVALUE pfn_GetValue = (PFN_GETVALUE)GetProcAddress(hMod, "_GetValue@8");
// if (pfn_GetValue) {
// return pfn_GetValue(indata, outdata);
// }
// FreeLibrary(hMod);
// }
// return -1;
//}
//__declspec(dllexport) int _stdcall RESGetValue(char *indata, char *outdata)
//{
// HMODULE hMod = GetInstance();
// if (hMod) {
// PFN_RESGETVALUE pfn_GetValue = (PFN_RESGETVALUE)GetProcAddress(hMod, "RESGetValue");
// if (pfn_GetValue) {
// return pfn_GetValue(indata, outdata);
// }
// FreeLibrary(hMod);
// }
// return -1;
//}
//__declspec(dllexport) int _stdcall GetRSACret(int partnerId,const char *storeID,const char *posNo)
//{
// HMODULE hMod = GetInstance();
// if (hMod) {
// PFN_GETRSACRET pfn_GetValue = (PFN_GETRSACRET)GetProcAddress(hMod, "_GetRSACret@12");
// if (pfn_GetValue) {
// return pfn_GetValue(partnerId, storeID, posNo);
// }
// FreeLibrary(hMod);
// }
// return -1;
//}
};
\ No newline at end of file
No preview for this file type
LIBRARY
EXPORTS
RESGetValue
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment