Sunday, December 13, 2009

DsiWin31 1.53a

This release fixes nasty bug (introduced in release 1.51) which caused various TDSiRegistry function (and other DSi code using those functions) to fail on Delphi 2009/2010.

Other changes:

  • Implemented DSiDeleteRegistryValue.
  • Added parameter 'access' to the DSiKillRegistry.
  • [Mitja] Fixed allocation in DSiGetUserName.
  • [Mitja] Also catch 'error' output in DSiExecuteAndCapture.
  • DSiAddApplicationToFirewallExceptionList renamed to DSiAddApplicationToFirewallExceptionListXP.
  • Added DSiAddApplicationToFirewallExceptionListAdvanced which uses Advanced Firewall interface, available on Vista+.
  • DSiAddApplicationToFirewallExceptionList now calls either DSiAddApplicationToFirewallExceptionListXP or DSiAddApplicationToFirewallExceptionListAdvanced, depending on OS version.
  • Implemented functions to remove application from the firewall exception list: DSiRemoveApplicationFromFirewallExceptionList, DSiRemoveApplicationFromFirewallExceptionListAdvanced, DSiRemoveApplicationFromFirewallExceptionListXP.

4 comments:

  1. Anonymous06:38

    The parameter idWindow seems to be incorrectly used in this call (the function takes a pointer):

    function DSiSendWMCloseToWindow(hWindow: THandle; lParam: integer): BOOL; stdcall;
    var
    idWindow: DWORD;
    begin
    // BAD: GetWindowThreadProcessId(hWindow, idWindow);
    // should be:
    GetWindowThreadProcessId(hWindow, @idWindow);
    if idWindow = DWORD(lParam) then
    PostMessage(hWindow, WM_CLOSE, 0, 0);
    Result := true;
    end; { DSiSendWMCloseToWindow }

    BTW, great library!

    ReplyDelete
  2. Delphi 2007 has two overloads of GetWindowThreadProcessId - one taking pointer and another 'var' parameter. Which Delphi are you using?

    ReplyDelete
  3. Anonymous14:10

    Delphi 5... Yes, I know...
    I didn't know about the overload, but thanks for the heads up. Note that the other calls to that same function in this unit use the pointer version of the overload.

    ReplyDelete
  4. New version uploaded. I have no problems maintaining compatibility with older Delphis - I just wanted to know what to put in the changelog :)

    ReplyDelete