Moniker.BindToObject(nil, nil, IID_IBaseFilter, result); crashed because
Moniker was always nil. Changed to:
function TSysDevEnum.GetBaseFilter(index: integer): IBaseFilter;
var
SysDevEnum : ICreateDevEnum;
EnumCat : IEnumMoniker;
Moniker : IMoniker;
// martin begin
{$IFDEF FPC}
Fetched : ULONG;
{$ENDIF}
// martin end
begin
result := nil;
if ((index < CountFilters) and (index >= 0)) then
begin
CocreateInstance(CLSID_SystemDeviceEnum, nil, CLSCTX_INPROC, IID_ICreateDevEnum, SysDevEnum);
SysDevEnum.CreateClassEnumerator(FGUID, EnumCat, 0);
EnumCat.Skip(index);
{$IFDEF FPC}
// martin begin
EnumCat.Next(1, Moniker, Fetched); // RESULT replaced by MONIKER, OD 27.02.2013
// martin end
{$ELSE}
EnumCat.Next(1, Moniker, nil); // RESULT replaced by MONIKER, OD 27.02.2013
{$ENDIF}
Moniker.BindToObject(nil, nil, IID_IBaseFilter, result);
EnumCat.Reset;
SysDevEnum := nil;
EnumCat := nil;
Moniker := nil;
end
end;
Original issue reported on code.google.com by ddaahhll...@gmail.com on 27 Feb 2013 at 9:10
Original issue reported on code.google.com by
ddaahhll...@gmail.com
on 27 Feb 2013 at 9:10