I have a server that needs to be protected with HASP.
I have a DLL with an exported function that is protected by HASP. Verification of a license occurs simply by whether an exception is thrown when the function is called.
When encrypting DLLs with default settings, if the key is not found, HASP displays a dialog with the OK button, in which an error message is displayed. When the server is running as a console application, everything is in order. But if the server is running as a Windows service, when you try to show this dialog, the server hangs.
I tried to make a conclusion not in the dialogue, but in the event log, or in the console. As a result, if the search for a key over the network is enabled, the program, not finding the local key, hangs forever, and if you turn off the search for the key over the network, if there is no key, no exception is thrown, and the program immediately ends silently.