|
DeviceIoControl在应用程序和驱动程序传递参数的问题??
[复制链接]
WINCE5中,在应用程序中,单击一个按钮,然后在执行以下代码
void CDiscDlg::OnDiscCapture()
{
// TODO: Add your control notification handler code here
BYTE *pDisplayBuffer;
DeviceIoControl(m_hCameraFile, CAM_IOCTL_SAMSUNG_CAM_PR, 0, 0, pDisplayBuffer, 1, 0, 0);
CDC *pDC = GetDC();
CDC bmpDC;
CBitmap bitmap, *pOldBitmap;
bitmap.CreateBitmap(320, 240, 1, 16, pDisplayBuffer);
bmpDC.CreateCompatibleDC(pDC);
pOldBitmap = bmpDC.SelectObject(&bitmap);
pDC->BitBlt(0, 0, 320, 240, &bmpDC, 0, 0, SRCCOPY);
bmpDC.SelectObject(pOldBitmap);
bmpDC.DeleteDC();
bitmap.DeleteObject();
}
在驱动程序中,CIS_IoControl中,定义了
BOOL CIS_IOControl(DWORD hOpenContext,
DWORD dwCode,
PBYTE pBufIn,
DWORD dwLenIn,
PBYTE pBufOut,
DWORD dwLenOut,
PDWORD pdwActualOut)
{
case CAM_IOCTL_SAMSUNG_CAM_PR: // ID=0x522
RETAILMSG(MSG_EN_1,(_T("CAM_IOCTL_SAMSUNG_CAM_PR\r\n")));
pBufOut = (PBYTE)0xa2ec3000;
break;
}
问题是:调试发现pDisplayBuffer的值不是0xa2ec3000,也就是没有把这个参数传成功,不知道为何?还有DeviceIoControl如果DeviceIoControl(m_hCameraFile, CAM_IOCTL_Movie_CAM_Start, 0, 0, 0, 0, 0, 0);是成功的,,,
另外#define CAM_IOCTL_SAMSUNG_CAM_PR 0x522
|
|