There are many occasions where you want to implement some functionality in a Kernel IOCTL or OEM kernel callback but you can't call the normal Windows CE API because you're in kernel space. So tasks such as setting or reading registry entries, creating events and signalling processes etc can't be done... or can they..?
NKSleep()
NKRegCloseKey()
NKRegCreateKeyExW()
NKRegOpenKeyExW()
etc
Note that not all of these are documented, so for more information see:
\WINCE600\PUBLIC\COMMON\OAK\INC\nkexport.h
More advanced functions are available in:
\WINCE600\PRIVATE\WINCEOS\COREOS\NK\INC\syncobj.h
This is the publicly available Windows CE private kernel code, and includes event, Semaphores and even message queues!:
NKSetEvent
NKPulseEvent
NKResetEvent
NKCreateMsgQueue
etc!
So don't use flags and share memory, do it properly with some thread and process intercommunication! :)
4 comments:
It appears that the only things the kernel allows you to do from the OAL in CE6 are defined in nkglobal.h. Inter-process synchronization doesn't seem to be supported.
Have you personally used these functions from the OAL in CE6? I don't see a way to do it, but if you've done this I'd love to have more details.
You can definitely add your own routines in, the HALREBOOT is an example of something that did something very similar already in CE5.0. The routine is redirected to the power manager when then calls the kernel directly to ensure caches are flushed, take a look at the private code.
Ig anyone is having problems with using the kernel functions, try defining these:
extern PPROCESS g_pprcNK;
BOOL NKEventModify (PPROCESS pprc, HANDLE hEvent, DWORD type);
#define NKSetEvent(pprc, hEvt) NKEventModify (pprc, hEvt, EVENT_SET)
Ig anyone is having problems with using the kernel functions, try defining these:
extern PPROCESS g_pprcNK;
BOOL NKEventModify (PPROCESS pprc, HANDLE hEvent, DWORD type);
#define NKSetEvent(pprc, hEvt) NKEventModify (pprc, hEvt, EVENT_SET)
Post a Comment