-
Content Count
1718 -
Joined
-
Last visited
-
Days Won
32
Everything posted by Angus Robertson
-
Windows 11 22H2 lost batch file association
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
But not in the GetIt scripts, and perhaps many other installers, which is why I brought it up. Angus -
Using System.Zlib instead of OverbyteIcsZLibObj
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
Busy finishing off other things, but the System.Zlib implentation will be the most painless and backward compatible solution possible, as are most ICS changes, don't like breaking things. Angus -
Delphi 11.2 seems to have new IDE bookmarks behaviour, which I understand is an IDE Bookmarks addin from Parnassus. In the IDE I have dozens of tabs open with different units, with bookmarks in a few of those units. If I right click to show the Bookmarks menu it lists bookmarks in the current unit, but if I select one the editor cursor jumps to a random bookmark in a different unit instead of the current unit. Just discovered there is a new docktable Bookmarks window that seems to work for the current unit, but the right click menu bookmarks I've used for 20 years are still useless. Angus
-
The Bookmarks docking window is not in Delphi 2007, so new some time since then, I've never looked for it before since the old way of using bookmarks worked perfectly, until Delphi 11.2. There are probably numerous other IDE features I've missed as well! I do like conditional lines being (sometimes) greyed in 11.2, very useful when working on projects with vast amounts of conditional code. Did not need to search for that, just worked. Angus
-
Search thumbprint in Windows certificate store
Angus Robertson replied to Droesjba's topic in ICS - Internet Component Suite
Yes, this is illustrated in the PemTool sample, on the Certificate Tools tab, select a Windows store and click Display Cert Store. This fills a TMsX509List using the LoadFromStore method, the sample displays the main information for all certificates found, but you can use the Find method to get the certificate with a specific SHA1 digest. If you want the SHA256 digest you'll have to loop checking each. Angus -
No, the Win64 path issue is not fixed by the patch, you have to manually patch the registry or change the library path, just done it, so ICS packages can again be built. Angus
-
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
That concept I can live with for a local dongle, the major problem I have is with shipping physical dongles around the world each year to be updated. customs do not like USB keys. Angus -
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
Yubico has a SDK for the ubiHSM 2 FIPS dongle which can be used with older OpenSSL releases using engines, then Osslsigncode updates the PE file authenticode signature. TPM2 might be easier, not sure if Yubico supports it. Angus -
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
I signed the OpenSSL binaries with a Certum dongle for a while, that prompted for a password for each file which was a pain, then Certum told us the dongle was obsolete and we'd have to buy a new one, so gave up and now using my Comodo/Sectigo certificate. One possible solution is to use OpenSSL to sign Windows PE files, there is project Osslsigncode intended to sign on Linux but can be built for Windows. Another project has a TPM2 provider for OpenSSL that should be able to read keys from dongles, although not checked if the Yubikey is a TPM2. Not a trivial project, but might be a good solution. Angus -
When I run a server application under the Delphi 2007 debugger on Windows 11, I'm seeing a lot of these lines in the debug window, although the server is behaving as expected with no new errors. Debug Output: onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(550)\nlansp_c.dll!6A1C85D4: (caller: 7523CD00) LogHr(16) tid(4c44) 8007277C No such service is known. The service cannot be found in the specified name space. Process webapp_telecom.exe (12000) No idea why onecore or net is being used, this is a Win32 application. I've had a DNS problem on the PC since I upgrade to W11 last week, lookups are sluggish as If it's trying the wrong server first, but nothing in the event logs. Angus
-
Delphi 2007/Win11 debugger
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
Not sure the current Microsoft API information is correct, I thought gethostname goes back to the early days of Windows, and Microsoft simply no longer documents versions of Windows it does not support. Reporting bugs to Microsoft is hard work, a while back I did get one fix where a SQL ADO DLL was leaking a handle for each async call, but it took a lot of effort, I rewrote my application to use a thread instead. Angus -
New security requirements for code signing, disruptive ?
Angus Robertson replied to A.M. Hoornweg's topic in General Help
The date for this change was 15 November 2022 but has now been postponed until June 2023. One way to put off the inconvenience of buying a $200 dongle and shipping it around the world is to buy a multiyear certificate now. I've got a three year certificate from K Software for $209, SSL.com would be $330 for three years, they sell durations up to 10 years, not sure that is allowed now. Angus -
Delphi 2007/Win11 debugger
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
Did the German language post suggest an alternative API? gethostname is used by the ICS LocalHostName function, and from my reading there is no alternative API. I guess the namespaceserviceprovider debug error is because the computer host name can come from several places, and internally an error on one location will cause it to look elsewhere. So it's something we just have to live with. A Stack Overflow suggests it's a Windows 11 bug: The behaviour you're seeing seems to be due to Layered Service Providers being deprecated as of Win11 (and potentially an upcoming Win10 update). GetHostByName is listed as deprecated, but GetHostName is not and also displays the same behaviour. In both cases the method queries any available namespace service providers first and then falls back to querying the NetBIOS name if none are found. As of Win11 it seems the call to enumerate the namespace service providers fails internally, generating the debug output you see. Angus -
Weird code in THttpConnection.ProcessWellKnownDir
Angus Robertson replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
No decision yet on how many old releases the next major version of ICS will support, partly down to age of old new language features, and partly because each time I add a new unit I have to update 100 to 200 .dpr, .dprog and .cprog files, something we should have automated a long time ago, but it's quicker to do it manually each time... ICS V7 will still be supported for new compilers and OpenSSL versions (unless totally breaking) and major bugs, but no new components or features, unless another contributor takes over that support and testing, I've now migrated all my D2007 projects to D11 so don't need to use D2007 any longer. Angus -
Delphi 2007/Win11 debugger
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
Thanks, since my last post I've updated my application from D2007 to D11.2, but still seeing debug lines. I'll now look very closely at Ics_gethostname and change it if possible. Angus -
Magenta Hardware Events Component is part of https://www.magsys.co.uk/delphi/maghardware.asp . It warns if a PC is power sispending or restoring, or closing down, nothing complicated, this is just simple windows messages. As Peter says, OnCloseQuery should fire on normal forms, but belt and braces is often better is you really need a clean close down. And no events fire on forced termination. Angus
-
Windows broadcasts power event messages before close down, WM_POWERBROADCAST or WM_POWER, I have a component for checking them. In theory you can suspend close down, but this can be ignored by Windows. If someone turns the PC power off, no events will occur, so if you really need to know it's best to write the date and time or something to a file every few seconds and on normal close down, and check it on starting up, so you know there was a clean close down and for how long. Angus
-
Weird code in THttpConnection.ProcessWellKnownDir
Angus Robertson replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
I too use MaxInt for new applications, but I've no idea whether it is available in all the ancient compilers ICS still supports, so always keep code a simple as possible. There is no complete list of new features, functions and constants added with each new release, When I needed to use PosEx to simplify some code, I had to use three conditionals as it changed three times since Delphi 7, had to search old source directories to find out when, which all takes valuable time. This won't matter for much longer since the next major release of ICS will cease support for compilers more than a few years old, so we can finally make use of new language features and remove lots of ANSI specific stuff. But we will changing too much old working code, since invariably changes introduce errors and often new things don't work properly. For instance when using TSearchRec to index files, I tried using the new TimeStamp property that returns TDateTime instead of Time that returns a file date stamp, but eventually discovered TimeStamp returns UTC time instead of local time, both undocumented in help so don't know if this is deliberate or a bug. But it meant my applications could not correctly compare source and destination directories when FTP or copying files, causing hundred of thousands of extra files to be copied, until I reverted to using Time. So new is not always better. Angus -
Windows 11 22H2 lost batch file association
Angus Robertson replied to Angus Robertson's topic in Delphi IDE and APIs
Lost file associations may depend on how you upgrade to 22H2. I downloaded the full ISO from Visual Studio Downloads, and did an in place update, as I've done for previous versions, since it is not available for Enterrprise from Windows Update. All applications and setting remained okay. .BAT was the only association removed (I think), others remained, but multi-media files all come up once asking how do you want to open this file, offering to continue using VLC as the first option, but suggesting Clipchamp as the first option, which I assume is some new Microsoft tool added to Windows 11. Angus -
Using System.Zlib instead of OverbyteIcsZLibObj
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
I recently added a IcsBuiltWith function to ICS to keep track of how I'm building the samples, there are RTL variables that can be checked for recent compilers: {$IFDEF VER350} Result := '11.0'; {$IF Declared(RTLVersion111)}Result := '11.1';{$IFEND} {$IF Declared(RTLVersion112)}Result := '11.2';{$IFEND} // both declared {$ENDIF} {$IFDEF VER340} Result = '10.4'; {$IF Declared(RTLVersion1041)}Result := '10.41';{$IFEND} {$IF Declared(RTLVersion1042)}Result := '10.42';{$IFEND} // both declared {$ENDIF} Angus -
ICS has a core function, probably unchanged for 20 years, that starts: { Return -1 if error, else return number of byte written } function TCustomWSocket.Send(Data : TWSocketData; Len : Integer) : Integer; begin if (FState <> wsConnected) and (FState <> wsSocksConnected) then begin WSocket_Synchronized_WSASetLastError(WSAENOTCONN); SocketError('Send'); Result := -1; Exit; end; .... My problem is that the SocketError function is quite complex, and has options to trigger event handlers with exception information. In a server, those error handlers are often considered fatal and may raise an exception or terminate the application, despite the function being documented as returning -1 for an error. For servers in particular, it is common for a connection to be lost unexpectedly, and this should not really trigger major exceptions. So I'm proposing to remove SocketError, so that error never returns an exception but returns as documented. But will this break existing applications that may rely on an exception? Angus
-
Using System.Zlib instead of OverbyteIcsZLibObj
Angus Robertson replied to EugeneK's topic in ICS - Internet Component Suite
Thanks, presumably it is conditional for Delphi 11.1 (I think) and later that contain the same ZLIB as ICS? Angus -
To be fair, it's my implementation of the ICS web server component that deliberately kills the server on an unexpected fatal error so that Service Manager Controller restarts it, because I know from 15 years experience of such servers that very rarely the server stops responding after a fatal error. ICS normally treats disconnection correctly, many other places don't cause the fatal error handler to be called, but just very rarely does this specific instance occur. For the moment, I'm now ignoring this particular error in the fatal error handler, but it's better never to happen. Angus
-
SocketError( } is important for raising terminal errors through the onBgExecption event, errors that can leave a server unresponsive, which is why I restart it. But SocketError( } treats all errors the same, fatal and non-fatal. In my case, a web hacker closed an HTTP connection before the server could answer, thus no connection while trying to send a response, and a server restart. Not common, once or twice a year from millions of connections, but still a bug. On reflection, I think we should raise a local exception in Send(), which the same behaviour as SocketError( } if an error handler event is not specified, which is less likely to cause backward compatibility issues. Angus
-
I build the packages on Delphi 7 periodically to ensure we've not used new language features, and until very recently all my main applications and servers were using Delphi 2007 which is only two releases later. The call stack you show does not appear to show any ICS components making calls. Angus