Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Violation in TSysDevEnum.GetBaseFilter() #14

Open
GoogleCodeExporter opened this issue Dec 25, 2015 · 0 comments
Open

Access Violation in TSysDevEnum.GetBaseFilter() #14

GoogleCodeExporter opened this issue Dec 25, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant