// ----------------------------------------------------------------------------
// EasyPOD.H
// ----------------------------------------------------------------------------
// 提供給客戶開發應用程式時需要參考的訊息或結構
// ----------------------------------------------------------------------------
// 2008/03/03
// ----------------------------------------------------------------------------
#ifndef __MEGAWIN_EasyPOD_DLL

#define __MEGAWIN_EasyPOD_DLL



// ----------------------------------------------------------------------------
// Function declaration
//

#ifdef EasyPODAPI
    // All functions/variables are being exported     
#else
    #define EasyPODAPI extern "C" __declspec(dllimport)
#endif

// If the function succeeds, the return value is zero.
// It means ERROR_SUCCESS.

#define USER_DEFINE_ERROR            ((DWORD   )0xE0000000L)

#define INSUFFICIENT_MOMORY_AVAILABLE           0xE0000001L
#define HIDD_GETATTRIBUTES_FAIL                 0xE0000002L
#define CANNOT_FINDE_THE_DEVICE_SPECIFIED       0xE0000003L
#define SEND_DEVICE_CHECKCODE_FAIL              0xE0000004L        
#define GET_DEVICE_CHECKCODE_FAIL               0xE0000005L   
#define CHECK_DEVICE_CHECKCODE_FAIL             0xE0000006L  
#define CALL_WRITE_DATA_TIMEOUT                 0xE0000007L  
#define CALL_READ_DATA_TIMEOUT                  0xE0000008L  
#define ALLOCATE_DEVICE_QUEUE_FAIL              0xE0000009L 
#define GET_INPUT_REPORT_SIZE_FAIL              0xE000000AL
#define DELETE_INPUT_QUEUE_FAIL                 0xE000000BL


typedef struct  _MW_EasyPOD
{ 
    DWORD VID;			        // Need to match user device's "Vendor ID".
    DWORD PID;			        // Need to match user device's "Product ID".
    DWORD ReadTimeOut;		    // Specifies the read data time-out interval, in milliseconds.
    DWORD WriteTimeOut;		    // Specifies the write data time-out interval, in milliseconds.    
    HANDLE Handle;              // Do not modify this value, reserved for DLL
    DWORD FeatureReportSize;    // Do not modify this value, reserved for DLL
    DWORD InputReportSize;      // Do not modify this value, reserved for DLL
    DWORD OutputReportSize;     // Do not modify this value, reserved for DLL
   
} MW_EasyPOD;

EasyPODAPI DWORD _stdcall WriteData( MW_EasyPOD * pEasyPOD, LPBYTE lpBuffer , DWORD nNumberOfBytesToWrite , LPDWORD lpNumberOfBytesWritten  );
EasyPODAPI DWORD _stdcall ReadData( MW_EasyPOD * pEasyPOD, LPBYTE lpBuffer , DWORD nNumberOfBytesToRead , LPDWORD lpNumberOfBytesRead  );
EasyPODAPI DWORD _stdcall ConnectPOD( MW_EasyPOD * pEasyPOD, DWORD Index );
EasyPODAPI DWORD _stdcall DisconnectPOD( MW_EasyPOD * pEasyPOD );
EasyPODAPI DWORD _stdcall ClearPODBuffer( MW_EasyPOD * pEasyPOD );

#endif