Here's where I found that "masm32 sdk" that contains the dll example code I mentioned earlier: MASM32 Home Page. Since I'm not familiar with masm32, I went to the example code to see how it does things.
Code:
.386
.model flat, stdcall
option casemap :none ; case sensitive
;...
TestProc proc
jmp @F
MbTitle db "Test function",0
MbMsg db "TestProc here",0
@@:
invoke MessageBox,NULL,addr MbMsg,addr MbTitle,MB_OK
ret
TestProc endp
Then link in this .obj and call it from a C app:
Code:
extern void __stdcall TestProc();
int main()
{
TestProc();
return 0;
}
You should be able do the same with "ADAMACMD":
Code:
// ADAM.h
#ifndef ADAM_H
#define ADAM_H
#ifdef __cplusplus
extern "C" {
#endif
/* ADAM control block structure */
/* all members aligned naturally, so no packing needed */
typedef struct
{
char AFILENAME[80];
char AOPCODE;
char ARETCODE;
char ALASTOP;
char AOPNCLS;
void *ABUFFER;
int *AKEYARG;
} ADAM_CONTROL_BLOCK;
extern void __stdcall ADAMACMD(ADAM_CONTROL_BLOCK *pcb);
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif //ADAM_H
Code:
#include "ADAM.h"
// Link with ADAMACMD.obj
int main()
{
ADAM_CONTROL_BLOCK acb = {"data.dat", 'O', '0', 'C', 'C'};
ADAMACMD(&acb);
return acb.ARETCODE;
}
I think that should be equivalent to your asm call, assuming ADAMACMD is a stdcall function.
gg