|
我最近在调试摄像头,在测试程序里面调用摄像头:
- // Open an instance of camera driver
- hCamDrv = CreateFile( CAMERA_INTERFACE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
复制代码
拍照,录像等操作都正常。
最后,
- CleanUp:
- RETAILMSG(1,(L"IOCTL_CAM_RSC_RELEASE\n"));
- //Sleep(20000);
- // Release access to Camera
- if ( !DeviceIoControl(hCamDrv, IOCTL_CAM_RSC_RELEASE, NULL, 0, NULL, 0, &dwBytes, NULL) )
- {
- RETAILMSG(CAMTEST_ERR,(L"[CAMTEST:ERROR] IOCTL_CAM_RSC_REQUEST Failed\n"));
- }
- RETAILMSG(1,(L"CloseHandle(hCamDrv)\n"));
- //Sleep(20000);
- CloseHandle(hCamDrv);
- RETAILMSG(1,(L"Return...\n"));
复制代码
发现CloseHandle(hCamDrv)这里就崩溃了。
如果把这里注释掉,程序可以正常结束。
崩溃信息:
IOCTL_CAM_RSC_RELEASE
CloseHandle(hCamDrv)
Exception 'Data Abort' (4): Thread-Id=0633000e(pth=849be390), Proc-Id=0632000e(pprc=849be270) 'cameraif_test.exe', VM-active=0632000e(pprc=849be270) 'cameraif_test.exe'
PC=80118df0(kernel.dll+0x00007df0) RA=80118eec(kernel.dll+0x00007eec) SP=d724fc80, BVA=0002ff08
Exception 'Data Abort' (4): Thread-Id=0633000e(pth=849be390), Proc-Id=0632000e(pprc=849be270) 'cameraif_test.exe', VM-active=0632000e(pprc=849be270) 'cameraif_test.exe'
PC=8011819c(kernel.dll+0x0000719c) RA=00000001(???+0x00000001) SP=d724f870, BVA=0002fefc
Exception 'Data Abort' (4): Thread-Id=0633000e(pth=849be390), Proc-Id=0632000e(pprc=849be270) 'cameraif_test.exe', VM-active=0632000e(pprc=849be270) 'cameraif_test.exe'
PC=801189c0(kernel.dll+0x000079c0) RA=fffff000(???+0xfffff000) SP=d724f890, BVA=0002fefc
Exception 'Raised Exception'(-1) Thread-Id=0633000e(pth=849be390) PC=801189c0 BVA=00000000
R0=d724f804 R1=d724f750 R2=c0082810 R3=d724f8c8
R4=00000001 R5=d724f8c8 R6=c00828c0 R7=00000008
R8=00000001 R9=80118ba4 R10=d724f734 R11=c0082c14
R12=80118df0 SP=d724f890 Lr=051fc000 Psr=6000001f
.....
下面不停打印:
Exception 'Data Abort' (4): Thread-Id=00570002(pth=8ffd7978), Proc-Id=00400002(pprc=82789308) 'NK.EXE', VM-active=043a000a(pprc=8efc9b68) 'explorer.exe'
PC=8012cc64(kernel.dll+0x0001bc64) RA=8012cc40(kernel.dll+0x0001bc40) SP=ffffc7ac, BVA=00000004
Exception 'Data Abort' (4): Thread-Id=057b0006(pth=8f3235ac), Proc-Id=00400002(pprc=82789308) 'NK.EXE', VM-active=00400002(pprc=82789308) 'NK.EXE'
PC=c0191010(gwes.dll+0x00051010) RA=c0190f88(gwes.dll+0x00050f88) SP=d5acfe5c, BVA=000000ac
Exception 'Prefetch Abort' (3): Thread-Id=057b0006(pth=8f3235ac), Proc-Id=043a000a(pprc=8efc9b68) 'explorer.exe', VM-active=043a000a(pprc=8efc9b68) 'explorer.exe'
PC=000313d4(explorer.exe+0x000213d4) RA=f101fffc(???+0xf101fffc) SP=0040fe70, BVA=000313d4
Exception 'Prefetch Abort' (3): Thread-Id=057b0006(pth=8f3235ac), Proc-Id=043a000a(pprc=8efc9b68) 'explorer.exe', VM-active=043a000a(pprc=8efc9b68) 'explorer.exe'
PC=40053928(coredll.dll+0x00043928) RA=80117bbc(kernel.dll+0x00006bbc) SP=0040fd2c, BVA=40053928
Exception 'Prefetch Abort' (3): Thread-Id=057b0006(pth=8f3235ac), Proc-Id=043a000a(pprc=8efc9b68) 'explorer.exe', VM-active=043a000a(pprc=8efc9b68) 'explorer.exe'
PC=40053928(coredll.dll+0x00043928) RA=80117bbc(kernel.dll+0x00006bbc) SP=0040fbe8, BVA=40053928
Exception 'Prefetch Abort' (3): Thread-Id=057b0006(pth=8f3235ac), Proc-Id=043a000a(pprc=8efc9b68) 'explorer.exe', VM-active=043a000a(pprc=8efc9b68) 'explorer.exe'
各位兄弟有知道什么原因的么?
|
|