| | | | Second, Win32 is fond of defining new data type synonyms for pointers by prefixing the target data type name with either a P, NP, or LP. To illustrate, consider the int data type. Win32 makes the following typedefs: | | | | | | typedef int* PINT; typedef int* LPINT; | | | | | | This happens for hundreds of different base data types. In an effort to make the rpiAPIData application more usable, it seemed appropriate not to include these variations. | | | | | | In case you are wondering, the prefixes NP and LP stand for near pointer and far pointer, respectively. This terminology is a remnant of the days of 16-bit Windows and Intel 80286 processors, when addresses were written in a segment:offset format in order to accommodate the fact that CPU registers were 16 bits wide and could therefore address only 216 = 64KB of memory. A near pointer was a pointer within the same 64KB memory segment, and thus required only an offset value. A far pointer pointed to another memory segment. If this is not familiar terminology, then you can consider yourself fortunate. (For more on all of this, allow me to suggest my book Understanding Personal Computer Hardware, published by Springer-Verlag, New York.) | | | | | | The designers of VC++ seem very fond of making typedefs using other typedefs. For instance, we find in two different include files: | | | | | | typedef unsigned long DWORD; | | | | | | typedef DWORD LPARAM; | | | | | | This is not a problem for VC++ programmers, but it does create a problem for us. After all, a VC++ programmer couldn't care less what size an LPARAM data type is, because he or she just uses the LPARAM keyword, as in: | | | | | | LPARAM lparam; | | | | | | However, we need to replace LPARAM with a suitable VB data type, so we need to know its size! | | | | | | Thus, from our perspective, it would have been nice if all typedefs were given in terms of some small set of basic data types, Instead, we must engage in typedef chasing. The origin field in Figure 4-1 is intended to refer (more or less) to the end of this chase, that is, to the basic type from Table 4-3, for which the name in question is a synonym. | | | | | | Please note that this is the first incarnation of rpiAPIData and it no doubt has many errors. Caveat emptor! Please send me an email when you find errors. | | |