For accessing Windows CE devices from my desktop application I used self-written DLL. This DLL used RAPI to call necessary functions on device side. Everything has been working fine for years.
But now I wanted to use this DLL in Windows service. And it failed. Debug shows that it is CeRapiInitEx() function that fails. And before failing it blocks for about 5 seconds, although MSDN says it is an asynchronous non-blocking function. GetLastError() gives me 1444L "Invalid thread identifier".
Someone on the internet mentioned that RAPI did not work from service threads in ActiveSync 4. Though the information is poor and scrappy.
Does anyone have the same problem or just have something to say? Is it true that RAPI is not accessible from Windows Service? If so, are there any workarounds?