帮我看看我的服务程序哪出错了
帮我看看我的服务示例程序哪出错了,为什么不会启动,我也用SamplePrivDeveloper.pfx签了名,生成的DLL有数字签名,名称为TEST USE ONLY - Sample Privileged Developer - Windows Mobile SDK
服务程序的签名也是用mapirule一样的签名方式吗?我的dll如果导出给我的程序用是可以的,求高人指点
按要求改写了注册表
// [HKEY_LOCAL_MACHINE\Services\MyService]
// "Dll"="MyService.dll"
// "Order"=dword:8
// "Keep"=dword:1
// "Prefix"="SRV"
// "Index"=dword:0
// "Context"=dword:0
// "DisplayName"="Sample Service"
// "Description"="This sample service makes your device beep about every 10 seconds."
服务函数的入口
MYSERVICE_API DWORD SRV_Init(DWORD dwData)
{
MessageBox(NULL,_T("ffff"),_T("ffff"),MB_OK);
MessageBeep(0xFFFFFFFF);
thread = CreateThread(NULL,0,MyControllingFunction,0,0,0);
return 1;
}
//Application specific stuff
//定时
void CALLBACK MyTimerProc(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent, // timer identification
DWORD dwTime // system time
)
{
//Beep every time the timer is triggered.
MessageBeep(0xFFFFFFFF);
};
//
DWORD WINAPI MyControllingFunction( LPVOID pParam )
{
// This will call MyTimerProc about every seconds. It might take longer
// as services run in the background. In this specific case MyTimerProc will
// produce a beep about every ten seconds.
m_nTimer = SetTimer(0, 0,1000, MyTimerProc);
MSG msg;
while (GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}