Discussion:
RegisterDeviceNotificaiton() with KSCATEGORY_CAPTURE to detect webcam access
(too old to reply)
s***@gmail.com
2018-06-22 06:57:01 UTC
Permalink
Hi,

Can I use below code to detect webcam access? I am not getting any notification on webcam access.

The RegisterDeviceNotificaiton has been called, like below:

DEV_BROADCAST_DEVICEINTERFACE filterData;
ZeroMemory(&filterData, sizeof(DEV_BROADCAST_DEVICEINTERFACE));
filterData.dbcc_reserved = 0;
filterData.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
filterData.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
filterData.dbcc_classguid = KSCATEGORY_CAPTURE;
ghDevNotify = RegisterDeviceNotification(ghwnd, &filterData,
DEVICE_NOTIFY_WINDOW_HANDLE);

Thanks in advance.
JJ
2018-06-23 12:09:36 UTC
Permalink
Post by s***@gmail.com
Hi,
Can I use below code to detect webcam access? I am not getting any notification on webcam access.
[snip]

No. The device notification is just for device (configuration) changes.

And KSCATEGORY_CAPTURE is a device classification. It's not a command.

If you're accessing the webcam using DirectShow, you might by able to
monitor the device access using a DirectShow filter.
JJ
2018-06-23 12:11:48 UTC
Permalink
Post by JJ
If you're accessing the webcam using DirectShow, you might by able to
monitor the device access using a DirectShow filter.
I mean, a custom DirectShow filter. The Windows' built in DirectShow filters
don't have any for device access monitoring.
s***@gmail.com
2018-06-25 08:52:54 UTC
Permalink
Thanks for the help..!!

Loading...