Thursday, February 19, 2009

How CreateEvent works!!! [WinCE]

The API takes three parameters:
1. Initial status (we determine).
2. Set/reset option like manual or automatic
3. Name of event

First it will validate the parameter like caller needs to be trusted if the named object is system prefixed.
Next check for the name of event in the linked list if it has been already used.

Now call critical section.

Now if the name exists then it will return with error.
Next check for the same object is already opened but name does not exist.

Now if the object does not exist then it will get allocated memory from heap for synchronous object.

Now it will get a pointer of the memory allocated before, and will check the size if available.
If available, then grab the memory and then will call INTERRUPTS_ON() which is nesting interrupts.

Then it will get handle for the object.
Name and security related check will be done.
Also for out of memory.

Now after getting memory, we will clear it by filling 0.
Then copy name and security descriptor. Now will call pfnInit() for the particular object.
Then we will have to set the parameter on manual set/reset.
Note - wince5.0

No comments:

Post a Comment

Please add your valuable feedback and suggestion...

Note: Only a member of this blog may post a comment.