各位弟兄:
我呼叫驱动这样呼叫的:
- typedef struct {
- CString DataType;
- CString number_HEX;
- }DATA_GETDATA_INFO;
- DATA_GETDATA_INFO GETDATA;
- int pfnGET_Data(CString bs1,CString bs2)
- {
- if(hFile_PLC == INVALID_HANDLE_VALUE) return -1;
- GETDATA.DataType=bs1;
- GETDATA.number_HEX=bs2;
- DeviceIoControl(hFile_PLC, IOCTL_GET_DATA, &GETDATA, sizeof(GETDATA), NULL, 0, NULL, NULL);
- (省略)
- }
然后驱动中这样写的:
- typedef struct {
- CString DataType;
- CString number_HEX;
- }DATA_GETDATA_INFO;
- DATA_GETDATA_INFO GETDATA;
- bool HPI_IOControl( DWORD context, DWORD code, UCHAR *pInBuffer,
- DWORD inSize,UCHAR *pOutBuffer, DWORD outSize,DWORD *pOutSize )
- {
- (省略)
- case IOCTL_READ_DATA:
- CeSafeCopyMemory(&GETDATA, pInBuffer, sizeof(GETDATA));
- DataType=GETDATA.DataType;
- number_HEX=GETDATA.number_HEX;
- (省略)
--------------
这样主程序的bs1,bs2可以正确对应到驱动中的DataType和number_HEX吗?
我总觉得这样怪怪的
各位推我一把吧!! ^^