HRESULT hr = S_OK;
KSPROPERTY ksprop;
ZeroMemory(&ksprop, sizeof(ksprop));
PVOID pData = NULL;
ULONG valueSize = 0;
ULONG dataLength = 0;
KSPROPERTY_CAMERACONTROL_S cameraControl;
ZeroMemory(&cameraControl, sizeof(cameraControl));
ksprop.Set = PROPSETID_VIDCAP_CAMERACONTROL;
ksprop.Id = KSPROPERTY_CAMERACONTROL_ZOOM;
ksprop.Flags = KSPROPERTY_TYPE_SET;
cameraControl.Property = ksprop;
cameraControl.Flags = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
cameraControl.Capabilities = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
cameraControl.Value = 50;
pData = &cameraControl;
dataLength = sizeof(cameraControl);
hr = m_pKsControl->KsProperty(
&ksprop, sizeof(ksprop),
pData, dataLength, &valueSize);
这里 hr “传递给系统调用的数据区太小了。”
我在 windows 7 机器上编译 vs 2010。