Hi ,Everyone.
I just take a test to open the video device “Display1” and to get a
File_Object for accessing the video buffer . Code I used :
PFILE_OBJECT VideoTest_OpenDisplayDevice(ULONG DisplayNumber)
{
WCHAR DeviceNameBuffer[40];
UNICODE_STRING DeviceName;
NTSTATUS Status;
PFILE_OBJECT VideoFileObject;
PDEVICE_OBJECT DeviceObject;
swprintf(DeviceNameBuffer, L"\Device\Video%d", DisplayNumber);
RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
Status=IoGetDeviceObjectPointer(
&DeviceName,
FILE_READ_ATTRIBUTES,//FILE_ALL_ACCESS ,
&VideoFileObject,
& DeviceObject
);
if (!NT_SUCCESS(Status))
{
DbgPrint(“Status=0x%x\n”,(ULONG)Status);
return(NULL);
}
return VideoFileObject;
}
The result is NULL, Status=0xc0000022,it means “STATUS_ACCESS_DENIED”.
Why?
–http://www.eyou.com
–Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢…ÒÚÓÊδ¾¡
–http://vip.eyou.com
–¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû