I am hooking to another application process using AppInit_dll, but this hooking is not working in Windows 10 machine.
If I disable secure boot UEFI it is working as expected.
Can anyone know alternative for AppINIT_dll
You can go for dll injection. Once the dll injection is done, you need to run a method infinitely and use another thread for your code to run in parallel.
Related
We have a VB6 program installed on all of our clients' local C drives, along with an associated VB6 DLL program. The program was written back before my time in the 90s. It was not designed to run off a server or to allow multiple user access to the same EXE at the same time, hence why it's on everyone's C drive. However, all running sessions of it refer to the same database source on a separate SQL Server via ODBC. The database connectivity works fine.
Ok that's all history, with everyone working remotely (Covid19)!
Today however, our clients are all remoting into a virtual server via RD Web. We want them to avoid using our VPN. We have TWO virtual servers allocated to RDweb users: TS01 and TS02, and license for up to 64 users. Every user is automatically allocated one of the two servers. If two people log in at the same time, and one in TS01 and the other in TS02 - everything is fine! It's when a 3rd person logs in and is given either of the servers, and runs the program, is when it crashes, with this error:
The DLL is registered in both Computer\HKEY_CLASSES_ROOT\ and Computer\HKEY_LOCAL_MACHINE\SOFTWARE\, but not LOCAL_USER, which I think is necessary to make this be a multi-user program, within a server environment.
Converting the app is not an option, as we don't have VB6 compilers. Do we need to wrap the DLL in "something"?
Any ideas how to get this legacy program to run for multiple users, are appreciated.
Thanks
Try installing/copying VB program and related DLLs in each users folders (like home folder and shortcuts pointing to these HOME directories). If the program runs, it should update the database in the same way. Sometimes, most workarounds are simple. If they need different locked DLL working space then give them that (May have memory issues later)
Please see this
https://stackoverflow.com/a/345154/12011019
and
https://learn.microsoft.com/en-us/archive/msdn-magazine/2005/april/simplify-app-deployment-with-clickonce-and-registration-free-com
Some DLLs are not designed to be shared and this behaviour cannot be modified without reprogramming. There are in process and out process (threads ) DLLs. Or there can be many other issues. If its not working, its not allowed by design.
https://support.microsoft.com/en-au/help/911359/a-client-application-may-intermittently-receive-an-error-message-when
The shared DLLs that are used system wide do not have this limitation as many they are designed to be used by many applications.
Please try and comment the behaviour.
I've been unable to find anything which really answers the question that I have, so if anyone can shed some light on the matter, I'd be grateful.
I'm not a Unix/Linux guy, so I'm running ActivePerl on Windows NT.
The scenario is this:
webscript.cgi calls background.pl to do some dirty work while the user continues browsing the site, using system($cmd). This works fine and all, but what I am wondering is THIS:
What happens if MULTIPLE calls are made within seconds of each other as a result of users actions to run background.pl? Will multiple instances of background.pl run simultaneously? Will one instance have to complete before the next can begin? Will any subsequent instances called simply fail? Or, will my machine begin to smoke and then perhaps explode? (chuckle)
Again, this is running in a Windows environment so I'm not sure if the rules with ActivePerl are a bit different than running in a Unix environment. Thanks to anyone who might have some information about this!
The web server doesn't know anything about the process running background.pl, so it does what it always does. It runs webscript.cgi which launches background.pl.
Now, if webscript.cgi waits for background.pl to complete, you could run into a situation where the web server stops accepting requests because all of its workers are running webscript.cgi. It will resume once a script ends.
All of this is very easy to test.
Will one instance have to complete before the next can begin?
No.
Will any subsequent instances called simply fail?
No.
Or, will my machine begin to smoke and then perhaps explode? (chuckle)
A poorly configured server could indeed be brought down by trying to run too many programs at once.
Getting powershell running on Linux is straightforward.
Unfortunately this is based on .NetCore which excludes a lot a important functionality and modules e.g the DNSServer module.
Is there a workaround to obtain a fully functional PowerShell installation on linux including modules that don't appear in .NetCore (specifically DNSServer) ?
Modules like DNSServer are owned and maintained by the DNS team within Microsoft and aren't part of the PowerShell project itself. This also means they aren't open source.
On top of that, for DNSServer specifically, that module uses WMI under the hood (I'd go so far as to say it's a thin wrapper around the WMI calls), and since WMI is also not open source and not available on Linux I'd say there's little chance of this module making there any time soon.
As a general case, your best bet is probably to use PSRemoting from Linux to a Windows machine that has the modules you want, then either use Implicit Remoting (Import-PSSession) or just straight up make remote calls with Invoke-Command.
I have a Perl application on Windows which uses threads which run in parallel. Each thread accesses an MSSQL database.
I understand that I can't use Win32::OLE because it is not thread safe.
Could you suggest me some another suitable solution for doing this?
Create a Windows service, which will access the database as a single thread and Perl will use this service?
Create another Perl app "server", which will access to DB as single thread app, and the Perl threads will use this service?
Use Win32::OLE (DBI) library only in child threads or by some safe way?
I don't know what the right way is, and what the ways to solve it might be.
DBI isn't dependent on anything other than the usual build and test modules that are used during installation
There is no DBD driver for SQL Server (I'm not clear why. Perhaps someone would enlighten me?) so you will need to use an ODBC connection using the DBD::ODBC driver
I'm unsure how DBI behaves under threads, and I suggest you use fork instead which is emulated on Windows versions of Perl. You will need to set $dbh->{AutoInactiveDestroy} = 1 to prevent processes from auto-destroying database and statement handles when they shouldn't
As suggested by #Borodin why not use DBIx::Class ?
It is thread safe. Maybe you should explain better the way your application have access to database. It seems that you have a "Windows server" that is a sort of Perl Module that use Win32::OLE and this server acctually talks with the database.
grails run-app will start my app in an embedded tomcat server.
I would like to configure this embedded server so that only a single request processor thread is available and that multiple threads are processed serially rather than concurrently (similar to default webrick behaviour in the rails world)
Is it possible? If so, how do I do it?
As far as I know, this is not directly supported by the Tomcat plugin. But you could easily modify the Tomcat plug-in and run your own version.
If you look at the class org.grails.tomcat.TomcatServer, you will see it starts a Tomcat instance.
Here is the doc for this class: http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html
There is a getConnector() method which will return the default HTTP connector. Once you have it, you can probably change the settings, like maxThreads.
But be careful the performance will be awful. But I guess you already know that.