This function opens a device for reading and/or writing. An application indirectly invokes this function when it calls CreateFile to open special device file names.
DWORD XXX_Open( DWORD hDeviceContext DWORD AccessCode DWORD ShareMode );
This function returns a handle that identifies the open context of the device to the calling application. If your device can be opened multiple times, use this handle to identify each open context. This identifier is passed into the XXX_Read, XXX_Write, XXX_Seek, and XXX_IOControl functions. If the device cannot be opened, this function returns NULL.
When this function is called, your device should allocate the resources that it needs for each open context and prepare for operation. This might involve preparing the device for reading or writing and initializing data structures it uses for operation.