Opened on 08/08/2014 at 05:39:29 PM

Last modified on 12/11/2014 at 11:31:02 AM

#1189 new change

Use the same Windows handle wrapper for extension and installer

Reported by: fhd Assignee:
Priority: P3 Milestone:
Module: Adblock-Plus-for-Internet-Explorer Keywords: installer
Cc: sergz Blocked By:
Blocking: Platform: Internet Explorer
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

Description (last modified by fhd)


ABP for IE generally uses AutoHandle as a Windows handle wrapper, the installer code uses Windows_Handle.

What to change

We should use the same class everywhere. Since Windows_Handle is more extensive and semantically a bit different, porting some of that to AutoHandle could make sense.

Attachments (0)

Change History (6)

comment:1 Changed on 08/08/2014 at 06:32:38 PM by

typedef handle< HANDLE, Allow_Null, Windows_Generic_Destruction > WindowsHandle
typedef handle< HANDLE, Disallow_Null, Windows_Generic_Destruction > WindowsHandleRef

With these definitions, I believe WindowsHandle is indeed semantically equivalent to AutoHandle.

WindowsHandleRef is the same type as the current (as of this writing) Windows_Handle.

I don't think using the name AutoHandle would be a good idea in the installer code. There are a lot of different kinds of handles required in that code to deal with MSI. Most of them are not Windows OS handles.

comment:2 Changed on 08/12/2014 at 11:31:11 AM by fhd

  • Cc sergz added

You're right, AutoHandle is not a good name at all. If it wasn't for other types of handles, "handle" generally means an object that handles ownership to some other resource - like smart pointers. WindowsHandle would be much better.

Now that we're using C++11, I'd actually prefer to turn these things into unique_ptr typedefs where possible. But we'd be missing out on the PHANDLE cast operator in the case of AutoHandle, and various things for the installer handles (e.g. not nullable ones).

Adding Serge since I'm not overly into WinAPI - what do you think?

comment:3 Changed on 08/14/2014 at 02:04:52 PM by fhd

  • Keywords installer added

comment:4 Changed on 09/30/2014 at 08:28:03 AM by fhd

  • Ready unset

Unsetting ready for now, since this is still under discussion.

comment:5 Changed on 09/30/2014 at 08:31:48 AM by fhd

  • Blocked By 1185, 1186 removed
  • Blocking 1184 removed
  • Description modified (diff)
  • Summary changed from [Installer cleanup] Use AutoHandle instead of Windows_Handle to Use the same Windows handle wrapper for extension and installer

Removed this from the installer cleanup meta issue - has a lower priority.

comment:6 Changed on 12/11/2014 at 11:31:02 AM by oleksandr

  • Ready set

Add Comment

Modify Ticket

Change Properties
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
Note: See TracTickets for help on using tickets.