Jump to content

Kas Ob.

Members
  • Content Count

    313
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Kas Ob.

  1. I agree on that, but about the part of plenty of code, well, that part is relative for example, the thread in question above should have TerminatedSet called in the destructor before the inherited Destroy this will make sure the thread is not blocking on an event that might not be triggered or will take long time to trigger, this is equal or the same as freeing the event (before the the inherited) and forget about it.
  2. Well, yes, but waiting on event that will not be triggered because the thread is trying to call the inherited destructor, for me is undefined behavior, will if finish or will it not and when ? Because the event is not triggered nor freed, TThread.Free in my opinion should never ever called, all and every TThread by design should clean up after themselves, well that is my humble opinion, the whole point of leaving a class/creature meant to run only once such as thread which can effecting the whole process, should be considered as falling knife, draw the path/loop or what ever then let it run its course cleaning and exiting gracefully.
  3. If TThread destructor being called while the thread is running then it is best to make sure the event handled closed and triggered (aka freed), preventing the thread from blocking on it, other wise it will go performing undefined behavior.
  4. Kas Ob.

    tform inside isapi webbroker

    DataModule should be created fine, the problem is what is on it !!? 1) The OP asked for non visible TForm, invisibility of TForm is irrelevant here, because handles for Windows classes is the prohibited in Windows Services, These Windows services are isolated from the user or interacting with the user. 2) Windows services are console application, this is very important, on top of that they are console application with modified policy to block all the GUI API https://learn.microsoft.com/en-us/windows/win32/services/interactive-services not only they can't create but also they cant open handles. 3) I created hundreds of DataModules in my services, in fact it is the cleanest or most efficient way to build Windows service, but you can't drop one VCL component on it, by that i mean a visible one or the one that create Windows GUI class, i faced some problems with a component should be as non visible component, but this component had hidden form/dialog to ask for a password if needed or programmatically asked to do so, that component was creating that input dialog in the constructor, this component had to be modified to be used in a DataModule in Windows Service. Now to guessing part to what did happen with your DataModule in ISAPI, most likely you have unit in uses clause that do some GUI initialization and does fail or something, see, i don't have the latest Delphi, but reading what have being changed and added, it might be the theming and skinning have something to do with, so in theory (i might be wrong here), you might used some component that is importing some of these units, or you have tested your module in an stand alone EXE and forgot to remove some unit from the uses clause, so i recommend to check the uses part, and track the offending component on that DataModule.
  5. Kas Ob.

    tform inside isapi webbroker

    Yes i know, and no it is impossible to create any GUI element from IIS ISAPI. The reason is simple your ISAPI is either running in-process or out-of-process of the INET/IIS, in both cases the ISAPI is hosted by Windows Service, all Windows Services are not allowed to create (or interact with) any GUI or have user desktop interaction.
  6. Kas Ob.

    Extend Standard VCL

    So for such cases these is "case" in Pascal/Delphi Case the control is CheckBox then the value is Boolean type Case of TMemo then the value is Base64 Encoded text. Case of something need more than one property then (like DataSet) MyDataSet.XX or MyDataSet_XX is TXX type .....
  7. Kas Ob.

    Extend Standard VCL

    Or if you want to go fancy, then build a class/component (a manager) that do that automatically, i mean enumerate all the controls and create an ini file with them, while it such in design time will enumerate all the controls and have a list at design time that can be checked to include/exclude from saving. Building such component will give you huge experience while being fun.
  8. Kas Ob.

    Extend Standard VCL

    Hi, Do it stupid simple, do you need it to be used or modified by users manually ?!! most likely no.. So, even for both cases (Yes/No) : Name these CheckBoxes with useful and clear names, then use the their names as Ini file Value while use for the Ini file Sections the Form/Frame name ... Don't forget to handle missed value with notification or errors or skip silently.... , For saving (or loading): enumerate all the controls in the form/frame and utilize the tag property to indicate the need to be saved/stored in Ini file or not. Just an idea !
  9. Kas Ob.

    Run in new desktop

    The first application i ran was ProcessExplorer https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer ,that way i can see what is going on, also i can do many tasks like kill the Windows Explorer and start it again, this like a rule of thumb for me, as this application most likely went through Microsoft testing also being used by millions, and followed the best practice to the letter. After it worked fine, and i failed to reproduce your black screen, tried few other application with GUI and console and no problem too. So try with it for easier get out of locked desktop.
  10. Kas Ob.

    Run in new desktop

    Can't reproduce this behavior on Windows 10.0.17134.706 . Tried many exe's and it worked flawlessly, aka returned to current desktop without a problem, tried some with GUI and console application some finish fast some takes time, everything is OK. One thing though, shouldn't be SwitchDesktop(curDesk) before CloseDesktop(deskHnd), to me this makes more sense instead of leaving it to the OS, also if the exe your are running is locking or using the Desktop it might interact with switching. Now to the guess part : something locked the newly created desktop, something like screen recording or Antivirus, most likely piece of software OS or non-OS based, locked the desktop or ran something on it and prevented desktop closing it, in other words the that desktop was busy. Observation : if i comment SwitchDesktop(curDesk); then after closing the newly ran process the desktop return automatically to my desktop, this indicate closing desktop worked and switching is even not needed. Even when i comment both lines Switching and closing, i still get return to my default desktop as this application after WaitForSingleObject does exit, hence auto closing the desktop handle and return me to my default desktop.
  11. If @xauxag can provide some more input about the locale and settings then it is possible to test it. I had being using https://github.com/xupefei/Locale-Emulator for years for the purpose of testing when such problem appear or for testing a specific non internationalized (English) application.
  12. Well, we have different meaning for hack/hacker as word, as it is like rubber nowadays and have being used not well defined term, it is not bad at all, it is a word describing ..... Wikipedia explain this way better than me https://en.wikipedia.org/wiki/Hacker Have heard about hackathons and their sponsors (like Microsoft, Apple, Google....) it is essential process in advancing technology evolution, to invent, share and spread knowledge also critical in security defense.
  13. What happen when you run the IDE as Administrator ?
  14. Hi, @ErikT , I would suggest : 1) Make WireShark your close and trusted friend, get familiar with it and use it extensively, depend on its result to diagnose what do you see against what you get. 2) Get familiar with nmap https://nmap.org/ , there is many resources to get you started, it is open source and great tool with many feature, use WireShark to understand its packets and get ideas from it, nmap has many ways (documented and undocumented) to scan an IP and even detect firewall presence on a remote IP.
  15. Hi, @alogrep Did you used "Run as Administrator" on the installer when installed the IDE ?
  16. This way better than depending on creating the file, BUT ... What/where is the locked file ?, who created it ? Here few scenarios should be a protentional problems: 1) Application/installer first run done by an administrator, will the locking file be accessed or lockable by others ? 2) What happen if user using RDP ran the application which either created that file or locked that file ? Anyway, my hate for file or registry locking is the need for more scenarios/situations to consider.
  17. Hi, What should/can happen with file locking in case of the owner application crash or system power failure (eg. unexpected restart) ? I prefer prefer memory locking or shared memory locking, but with extra step like have a background thread acting like watch dog and make sure there is time out or constraints to keep the lock active and control or process -> exiting/finishing/wrapping up/reporting/terminating/(asking the user for interaction).... As or file locking if you prefer it, then make sure to have some data in it like the owner PID (process ID) or the time of system started, both.... You need to think about different scenarios before committing to potentially permanent locking like files and registry, for me they are somehow risky and dangerous.
  18. Thank you ! That is the word i was looking for.
  19. Please try this instead procedure TForm1.Button3Click(Sender: TObject); var s: AnsiString; ServerKey: string; begin s := AnsiString(edit1.Text); ServerKey := Base64Encode(SHA1ofStr(s)); Memo1.Lines.Add(ServerKey); end;
  20. I don't see any bug or wrong here, used the same 3 lines like yours and the same value. On other hand if ICS Base64 encoding is broken then it is amazing to perform anything at all !
  21. This means the size of memory being used is very limited, or somehow limited and contained. In this case i would suggest to start to adjust the old code first to maintain huge block of memory enough for these structures, then replace all the pointers with relative address pointers, by that i mean all will point to SOME_ADDR + BASE_ADDRESS, as such the address pointers could be only 32bit, while BASE_ADDRESS is irrelevant and will be applied once by the code after allocating the memory (aka after loading or transferring the whole block). This will allow you to compress the used memory, but under condition that you don't use the default memory manager and allocate these record/structures on you own. But again, before streamed/serialized you could transfer the structures and replace all the pointers with relative ones to the base, which be default could be 0.
  22. I really hate that !, "no range no value" does sound like undefined behavior. For me, always one of two for a search result : 1) return (-1) for not found or a valid index in a simple and plain list, array.... , same with pointers and linked list return 0 for not found, can be checked with Assigned. 2) return a boolean true for success with var parameter for index, internal associated data....structures, pointers...could also return a pointer and the next one or the previous in one go...
  23. Kas Ob.

    indy https error 10061

    The only thing that makes sense given what you have described is if there is a local AV/Firewall running on the client machine that is blocking the connections from TIdHTTP directly, but has an exception which allows Fiddler to make connections. I second that, it is app control by either Windows Firewall or Defender or 3rd party firewall. Remember that the default behavior on Windows can be adjusted with a policy, so the firewall could blocking public access for outgoing, while allowing home network and/or private network, this explain that behavior, so the old application have a policy while the installed local proxy adjusted its firewall role. in other words the application that using this DLL is marked by firewall or some security software, and it might be not visible in the simple outgoing roles setting.
×