Can I use svchost.exe to host my own services? - winapi

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

Related

"This program might not have installed correctly"

I am aware of both this and this questions.
Which unfortunately didn't quite answer what I'd like to know:
The answers in the above questions suggest that it has to do with adding shortcuts to the start menu, but that can't be the sole reason. So far I've been unable to reliably figure out what makes windows think my application is an installer in the first place and why does windows think it failed?
I do not want to simply suppress the message with a compatibilty tag in the manifests. I want to write a proper solution and tell Windows if my installation has failed or not. Also, what does the install using recommended settings option do, that comes along with the dialog? How can I properly utilize this functionality? Again, I don't want to simply disregard the features Windows provides, I'd like to use them.
I've been browsing around MSDN but with no success. I've asked google, but all I could find is ways to suppress the message using compatibility tricks in either the manifest or the registry. I'd be already grateful if someone could provide a viable resource on MSDN that covers this topic well.
So far, I am using a custom installer that utilizes several Windows API calls. I am not messing around with the Windows Registry other than registering two services. It also has requireAdministrator as the requested execution level (not that anyone cares, but this is suprisingly clean and simple - it's merely a flag in the project settings). I am currently not using MFC or CLR.
See Installer Detection, it lists what is checked to decide whether an executable is an installer.
"This program might not have..." is a product of "Program Compatibility Assitant", and is documented in the Application Compatibility: Program Compatibility Assistant (PCA) topic. According to the document the reinstall option applies XPSP2 compatibility mode.

how to load API on Windows 7?

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

Automating adding sites to IIS7

I'm building some scripts for automatically setting up a developer's machine so everyone has an identical setup & configuration.
One thing in particular I want to automate is the configuration in IIS7. We have a bunch of web apps which need to be hosted locally and would ideally like them all set up automatically. Does anyone know of a sensible way to do this?
a little bit of Microsoft.Web.Administration + a bit of LINQPad and you're laughing.
its fairly easy with the powershell snap in
Edit: The MSDN docs are pretty whack as usual, but if you rummage about enough you can eventually find all the commands available to you

Wanted: WinAPI calls logger

There was an "API Monitor" program, but it seems discontinued. Doesn't work on my system.
Is there any such tool, which can work on Windows 7 x64?
I need to log API calls from a selected set, better when parameter values.
I use the API Monitor tool at http://www.rohitab.com/apimonitor. It's not abandoned, the author seems to be releasing regular updates including some from the past year. I found it relatively easy to learn, and have used it to discover API calls made by some components of Windows that I was studying, among other debugging tasks.
Heres is an list of such tools: http://www.woodmann.com/collaborative/tools/index.php/Category:API_Monitoring_Tools. You could try the first one, its OpenSource and was last updated this year: http://jacquelin.potier.free.fr/winapioverride32/
Edit:
You could try this one for x64 http://www.autodebug.com/
There's also Detours, free from Microsoft, it's a library to hook the windows API, but it's not a complete monitor program, you have to do some work to intercept the API calls.
http://www.bladeapimonitor.com/ seems to be doing what you need.
Depending on what you want to see, Procmon might also do the job.

How do I make Remote Assistance as painless as possible?

I need to provide remote assistance to the users of my app, through the Internet. I need a reference for doing this, and I need to make the whole connecting to remote desktop process as easy as clicking a menu of my app for my users.
I don't want them to get too involved with the procedure. I believe the built-in remote assistance features of Windows XP and Vista are fine, I just need to make it very simple.
Anyone any ideas?
P.S. A comprehensive reference on the whole Windows Remote Assistance would also be appreciated.
I highly recommend Mikogo. It's free, fast to install and setup, works great, and is very simple. I actually prefer it to the more expensive services ($30-$40/month) because of it's simplicity. Only thing is, I'm not sure how they make money, they have some advertising when you visit the home page, but it's very minimal.
There are many commercial tools that do make this operation effortless. I won't mention any names because this isn't an advertising forum. A quick search should turn up a handful of possibilities; I've used many of the more popular ones and found them satisfactory.
Our support desk typically uses WebEx which works really well.
There are a large number of tools which will do this. Your best is to pick a tool which has a reverse connection from the person who needs help back to the helper. This will make sure that you do not have users try and configure firewalls/open ports etc. Webex is a good recommendation by Old Nick. Another option is GotoAssist, there is also Gotomeeting which can have the same remote control functionality and is cheaper i believe. The main thing is making sure it is as easy as it can be for your users, trying to walk a user through installing an active-x control can be hard enough.
I'd suggest trying LogMeIn. It's nice because once you have the user set up the client software, you can arrange with them a time to leave their PC unattended so that you can remote in and take a look (with the option to disable local keyboard/mouse and monitor access). You can also connect such that the local peripherals are enabled and watch "over their shoulder" as they replicate a problem.
There is of course also Copilot by Fog Creek. Have never used it myself, but it looks pretty easy to use, also for non-technical people.
I use CrossLoop for that kind of thing

Resources