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.


  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;
    idWindow: DWORD;
    // 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!

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

  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.

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