Win32 System Programming
|
Notes on Windows CEA large sample program is in the samples file. MicrosoftÆ WindowsÆ CE is a platform designed for embedded systems, communication devices, entertainment systems, palmtop PCs, and a wide range of resource-restricted devices. The important point for us is that it provides a subset of the Win32 API, so, with some care, Win32 programs can operate under Windows CE. Furthermore, a person wanting to learn Windows CE system programming can use the material in this book, with suitable restrictions. Note: "CE" probably denotes "Consumer Electronics" the same way the "NT" probably denotes "New Technology." Some people, however, note that if you decrease each letter in "WNT" you get "VMS" the venerable operating system from Digital Equipment Corporation. These notes, which I'll augment from time to time (please feel free to send me any relevant information) will describe the significant Windows CE limitations and differences with respect to Win32. In addition, programming examples will illustrate various techniques that are relevant to Windows CE. The first example shows how to implement semaphores using mutexes and an event. Windows CE provides these two objects, but it does not provide semaphores. This example will also be interesting to Windows 95/98 and NT programmers as it illustrates a number of synchronization features and behaviors that may not be obvious. For more information on Windows CE and to obtain the development kit (you need to be using Visual C++ Version 5.0 or greater), see the Microsoft page at
Here are some initial notes regarding Windows CE relative to Win32. I/O
SecurityNo security, so the security attributes should be null in all calls. Does this mean that handles cannot be inherited? Yes, it does. Processes and Threads
CreateProcess
The root directory of the PCMCIA RAM expansion card, if one exists (see the Microsoft home page for information) The windows directory; (\Windows) The root directory; (\)
TerminateProcess
CreateThreadEach process has a primary thread that is created automatically when the process is created. Additional threads can be created by calling the CreateThread function. The ExitThread function should be called to free up the resources used by the thread when it is no longer needed. Calling ExitThread for an application's primary thread will cause the application to terminate (this use of the primary thread appears to differ from normal Win32 - check). Windows CE does not support the TerminateThread function used for one thread to kill another thread (this is the opposite from processes). Synchronization
Windows CE Semaphore - Sample Code
See the sample code file. |