This definition style is common on the Windows platform. In the days of 16-bit segmented architectures, each typedef structure definition also had 2 typedefs for near and far (also called long pointers):
typedef LPVOID UKWD_USB_DEVICE; typedef struct _UKWD_USB_DEVICE_INFO { DWORD dwCount; unsigned char Bus; unsigned char Address; unsigned long SessionId; USB_DEVICE_DESCRIPTOR Descriptor; } UKWD_USB_DEVICE_INFO, NEAR * PUKWD_USB_DEVICE_INFO, FAR * LPUKWD_USB_DEVICE_INFO;
near pointers were 16 bits wide, and far pointers were 32 bits wide. Most Windows APIs took far pointers, and their prototypes used pointer typedefs. By the way, LPVOID was defined as follows:
typedef void FAR *LPVOID;
32-bit Windows appeared in 1995 and made it obsolete. near and far keywords were kept for a while, defined as empty, for compatibility reasons.
Compatibility with 16-bit Windows has long been useless, but usage is still delayed as typedef is still used, but the far and near keywords have been removed.
The space between * and PUKWD_USB_DEVICE_INFO ignored, but I agree with you that it is quite difficult to enter it there.
source share