My intention is to be able to sucessfully load a .dll file that will hook the Windows API. I have researched and tried extensively, without success, any method that would load my .dll file on a 64bit machine running Windows 7. The two solutions that I have tried include loading the path of the .dll into the registry keys:
Computer/HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
or
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
please don't get me wrong, there are many online resources explaining how to load APIs to the registry, but none of them have worked for me. I apologize if the answer to this question is obvious, I have tried everything I could. Thanks so much for the time and help!
Don't use the AppInit_DLLs mechanism as it is very dangerous and can lead to crashes and loader-lock deadlocks in other applications (see what the great Raymond Chen has to say on the subject). If you absolutely, positively must use this mechanism then you can only call functions in kernel32.dll. No runtime calls at all.
A better option is to look into using the detours library
There's a Technet document which might help - AppInit DLLs in Windows 7 and Windows Server 2008 R2
Related
I would like to know where I could find good resources/documentation on configuring a new Windows10 installation using Powershell scripts. I know bash but I'm completely new to Powershell.
When I search google, all I can find about automatically configuring Windows relates to Windows Deployment Services. But I don't have and don't want a Windows Server and simply running a few scripts after each installation is sufficient for me.
I found a few scripts that solve some of the things I want to do:
https://github.com/FlatlanderWoman/winCleaner
https://github.com/hahndorf/Set-Privacy
But for everything else, when I look into the TechNet Library I find it very hard to find anything useful. And when I do find something, it looks outdated:
https://technet.microsoft.com/en-us/library/hh852115.aspx
The problem is: I known the GUI-way of configuring everything I want, but I don't know how to find the corresponding commandlets to do the same with Powershell.
Is there some kind of event listener I could use to find the Cmdlets? Or does anyone have some resources/documentation to recommend? Is the TechNet Library really the established way to find these commands?
Thank you.
Unfortunately PowerShell was only really implemented in Windows 7 (yes I know it was available for XP but not preinstalled) and even then it was kind of like an addon rather than part of the core OS. Windows 8 and 10 have further improved functionality but still for the most part do not use it for their own settings and functions as most home users would have no use for it.
However there is nearly always a way to do whatever you need to, I have a script that configures servers from scratch, renaming the server, installing requisite software and features, copying files, configuring VSS, right down to putting the Computer icon on the desktop. You just have to make a list of everything you want to do, then Google each one.
For example: https://www.google.co.uk/search?q=powershell+put+computer+on+desktop - at time of writing the first result is a TechNet script pointing at a registry key. Tidy as necessary, whack into your build script and move on to the next item.
As of yet there's nothing I've found I've been unable to do with PowerShell, but the vast majority of it has not been directly with cmdlets. There's a lot of registry tweaking and command line stuff like msiexec or schtasks, some COM objects and an awkward Type I had to create and use to set the DNS suffix.
Overall I think it's still easier to do all this in PowerShell than any other scripting language and it's more flexible than premade tools, not because it has so much functionality built-in but because it can access .NET and COM which gives you broad access to all the half-baked stuff MS have wedged in over the years.
I am trying to run a program on Visual Studio on a XP computer and i am getting the error in the heading. I have all the service packs for XP and VS. Never seen anything like this before so i really dont have a clue. Anyone seen this problem before or know what might be going wrong?
This API is aviable since Vista see also the MSDN chapter requirements:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684919(v=vs.85).aspx
So far that API is simply not aviable. Try to search something equal for XP.
I've written a new Visual Studio language service for my software studio's internal scripting language following the directions from a very useful article Writing Your First Visual Studio Language Service. I've got my grammar working great, some simple goto cases up and running, and text coloring. I've done my testing both in the Irony GrammarExplorer and the Visual Studio Experimental Hive, and I feel I'm ready to use it normally in visual studio and deploy it out to a few other programmers for some early testing and feedback.
The problem is I don't know how to install the language service. I have this nice little DLL that works in the Experimental Hive, but no clue how to have it running whenever I start up visual studio. I've looked all over the internet and found that particular step is glossed over everywhere I look. Maybe I'm just blind, or it's much easier than I think it to be, but I'd really appreciate it if someone could give me detailed steps on how to install my language service.
Thanks in advance!
After getting the Tumbleweed badge on here I managed to track down the solution. There were a couple important bits people might find useful.
First off a PLK (Package Load Key) is needed. It can be generated here: http://msdn.microsoft.com/en-us/vstudio/cc655795.aspx
Be sure to make sure that all the information you enter is correct, and is entered into the Assembly for the dll.
The PLK is installed by adding to the rsx file for the solution, usually as item 104, and then matching that item number in the ProvideLoadKey attribute in your code.
Next testing the PLK is a bit of a hassle. Tips can be found here: http://msdn.microsoft.com/en-us/library/bb164677%28v=VS.90%29.aspx I highly recommend first using the /noVSIP switch with the experimental hive right from the start. I found using /log doesn't really help, it's much better to use the Package Load Analyzer once you've installed your package and are still having PLK issues.
A more detailed description from the package load analyzer can be done with this command line:
devenv /command tools.analyzepackage /analyzeargs {your GUID} analyzepkg.txt
Once you're satisfied and ready to deploy, there is a tutorial that seemed more buried than it should be over at MSDN http://msdn.microsoft.com/en-us/library/bb458038%28VS.90%29.aspx
One thing that I found was curious with the RegPkg tool found in the VS SDK bin directory was that it would cause my package to load fine in the development solution it existed in, but would not not load in other solutions. There appears to be an extra step to call devenv /setup which I was missing, and this is taken care of in the deploy tutorial I provided in the previous paragraph through the use of a Custom Action.
Anyway I hope this helps someone running through the same process as me.
One other thing that I spent a couple of hours bumping into that the MSDN tutorial doesn't mention: If you're deploying to a 64-bit computer, the instructions as given won't work. After quite a bit of searching, I stumbled across a posting halfway down this forum thread that explains it: http://social.msdn.microsoft.com/Forums/en/vsx/thread/989c5bea-3dd0-4e60-891a-f8f006e1b9a2
The MSDN tutorial says to install your registry keys here and regpkg.exe generates registry keys here as well:
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\...
But on 64-bit computers, Visual Studio loads its settings not from there but from here:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\9.0\...
Notice that extra "Wow6432Node" in there; the registry keys are otherwise identical but for that extra "Wow6432Node" in the path. So on 64-bit machines, you'll either need to use those extended registry keys, or you can install a hybrid 32/64-bit .dll to both sets of registry keys without ill effect. I have a .reg file that installs to both sets of keys, and it works very nicely.
Hope this helps save somebody else some time!
(For what it's worth, I used the "Codebase" mode for regpkg, not the "Assembly" mode.)
I just came back to C++ Builder after 5 or more years away. I seem to remember a nice tool where I could drag its pointer over the GUI of my running application and get lots of info about what was pointed at - handle, size, text, parent, children, etc
IIRC, if the exe include debug info I could also get the actual variable name as used in the source.
Does anyone know what program I am talking about? Thanks
There are several options:
Winspector
This is the program I've used the most of these Spy++ like programs, it has all the features I needed and worked without complaints on my developer machine, it has been quite some time since I've used it though. And the official site seems to be down for some reason ( http://www.windows-spy.com/ ) but luckily you can get a version from softpedia: http://www.softpedia.com/get/Security/Security-Related/Winspector.shtml
WinSpy
I have used this program for debugging, and finding out which messages was sent to different windows, it worked quite well, and was a good alternative to Spy++, besides it is free. You can download it from here: http://www.catch22.net/software/winspy
SpyStudio by Nektra
I have never tried this program but it actuall seems to do what you asks, and it is free. It can be found here: http://www.nektra.com/products/spystudio-api-monitor/
(source: nektra.com)
WinID
From what I've heard WinID should be able to perform much of the same, but I have never tried the program myself. You can download it from here: http://www.dennisbabkin.com/php/download.php?what=WinID this program is not compatible with Windows Vista though (and probably not Windows 7 either).
The challenging option
If there is a bit of a pioneer in you, you might want to create your own utility, although this is most likely not what you want, but if so you can check out these codeproject pages:
http://www.codeproject.com/KB/graphics/screen_capturing.aspx
http://www.codeproject.com/KB/dialog/windowfinder.aspx
These are all a lot like the Spy++ program that came with Visual Studio. Last but not least you might find other programs in this thread: I want Spy++ but I don't have Visual Studio
A very decent effort to revive the beloved but defunct winspector is window detective : http://windowdetective.sourceforge.net/
What you describe in the question sounds like TestComplete. http://www.automatedqa.com/products/testcomplete
If you compile the application as an "open application"(you add a few .pas from TestComplete to the project) then it will use the debug information and you will be able to see private data members of the classes and their value.
I can't find documentation for how to do it, which makes me think I'm not supposed to do it.
No, svchost.exe is undocumented and only supported for services that are part of Windows.
Part of the reason is reliability - a crash in a 3rd party service should have no effect on a critical Windows service.
Why do you want to use svchost? Do you have several services that you want to combine together? Creating your own exe to host multiple services is pretty straightforward.
Comment in this link will help you out, its too much to cut/paste here. Source is C++ as you didn't specify a language I dont think it will matter.
The Link
EDIT: For the record, I am not saying it's a good idea.
You can download the windows NT resource kit (http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en), and follow these instructions to create a service out of anything: http://support.microsoft.com/kb/137890