dll入口函数BOOL WINAPI
DllEntryPoint(HANDLE hinstDLL,
DWORD dwReason,
LPVOID lpvReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
RETAILMSG(1,(TEXT("STRINGS:***@@****DLL_PROCESS_ATTACH******\n")));
return TRUE;
case DLL_THREAD_ATTACH:
RETAILMSG(1,(TEXT("STRINGS:***@@***DLL_THREAD_ATTACH*******\n")));
break;
case DLL_THREAD_DETACH:
RETAILMSG(1,(TEXT("STRINGS:***@@***DLL_THREAD_DETACH******\n")));
break;
case DLL_PROCESS_DETACH:
RETAILMSG(1,(TEXT("STRINGS:**@@**DLL_PROCESS_DETACH******\n")));
break;
}
return true;
}
该函数也没有打印信息。
XXX_init()函数DWORD ITT_Init(DWORD dwContext)
{ // if you drive a idiographic device,add oter code ep: int,hardwareinit and so on
DWORD IDINTThread;
RETAILMSG(1,(TEXT("MYSTRINGGS:**@@*******InitKey_Init***********\n")));
//clear the ram which is used for this dll
InitializeAddresses();
Key_Key_Thread = CreateThread(0,0,(LPTHREAD_START_ROUTINE)Key_KeyThread_Fun,0,0,&IDINTThread);
if(!Key_Key_Thread)
{
RETAILMSG(1,(TEXT("@CreateThread faile \r\n")));
return FALSE;
}
else
{
RETAILMSG(1,(TEXT("@CreateThread OK \r\n")));
}
return TRUE;
}
static DWORD Key_KeyThread_Fun()
{
INTInit();
Key_KeyIntr_Event = CreateEvent(NULL,false,false,NULL);
if(!Key_KeyIntr_Event)
{
RETAILMSG(1,(TEXT("@CreateEvent faile \r\n")));
return FALSE;
}
else
{
RETAILMSG(1,(TEXT("@CreateEvent OK \r\n")));
}
if(!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR,&INTIrq,sizeof(INTIrq),&INTIntr,sizeof(INTIntr),NULL))
{
RETAILMSG(1,(TEXT("@ERROR:kerneliocontrol.\r\n")));
return(FALSE);
}
else
{
RETAILMSG(1,(TEXT("@KernelioControl OK\r\n")));
}
if(!InterruptInitialize(INTIntr,Key_KeyIntr_Event,NULL,0))
{
RETAILMSG(1,(TEXT("@Interruptinitialize failed \r\n")));
return FALSE;
}
else
{
RETAILMSG(1,(TEXT("@Interruptinitialize OK \r\n")));
}
while(1)
{
WaitForSingleObject(Key_KeyIntr_Event,INFINITE);
RETAILMSG(1,(TEXT("@Thread id running :times == %d\r\n"),i1));
i1++;
InterruptDone(INTIntr);
}
}
要在platform.reg和platform.bib加上你DLL的信息,如果是在6。0上,还要加上K的flag
platform.reg
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\XXX]
"DLL"="ITT.dll"
"Prefix"="ITT"
"Index"=dword:1
"Order"=dword:1
"FriendlyName"="XXXDriver"
platform.bib
XXX.dll $(_FLATRELEASEDIR)\XXX.dll NK SH
要么是注册表写的有问题。。再就是你的bib文件写的有问题
wincd6.0 注册表。
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\INTl]
"Dll"="INTkey.dll"
"Prefix"="ITT"
"Index"=dword:1
"Order"=dword:0
bib文件:InitKey.dll $(_FLATRELEASEDIR)\InitKey.dll NK SH
有错吗?
"FriendlyName"="XXXDriver"
这句是做什么的
没有看出来什么问题,楼主可以先用下面的方法确定是否最终build到image中,以及注册表是否生效:
1. viewbin -o -nk.bin(这个要看你用你最终生成image的名字)
2. 看一下release目录下的rege***.ini里有没有你刚才提到的注册项
引用: 引用 12 楼 jiereliyi 的回复:
引用 9 楼 guopeixin 的回复:
没有看出来什么问题,楼主可以先用下面的方法确定是否最终build到image中,以及注册表是否生效:
1. viewbin -o -nk.bin(这个要看你用你最终生成image的名字)
2. 看一下release目录下的rege***.ini里有没有你刚才提到的注册项
都被包含进去了。
导出函数有问题么?我是指ITT_Init会不会没有导出呀?