473,799 Members | 2,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: CreateProcessWi thLogonW

What you are experiencing is a security feature in Windows 2000+. If one
application uses SetWindowsHookE x() to hook another application run by a
different user, the hook fails, even if the target process is visible and on
the same desktop. I just tried this with Notepad, it works fine when I start
it as the same user, and doesn't work when I use Run As to start it as a
different user(tried Administrator and Power User). I am logged in using an
account that is a member of the Administrators group. SetWindowsHookE x()
returns 0 in these cases and GetLastError() returns 5, Access is denied,
ERROR_ACCESS_DE NIED. The hook procedure is in a C++ DLL.

Also, in Vista and later, SendMessage can only send messages to processes
with the same privilege or lower, otherwise it fails with error access
denied. See here:

SendMessage Function
http://msdn2.microsoft.com/en-us/library/ms644950.aspx

Finally, while on the same subject GUI and security, staring with Vista;
services run in their own terminal services session for security reasons, so
services that create a hidden window to let other applications talk to it
using SendMessage(To configure the service, for example) will be blocked
from receiving such messages in Vista and after. You have to use another
method like named pipes. See here:

AC: Session 0 Isolation
http://msdn2.microsoft.com/en-us/library/bb756986.aspx
Jun 27 '08 #1
0 788

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3435
by: Arne | last post by:
Hi, I'm working on an asp.net application that reads a users username and password, and starts a process with the username read. The problem is that the program returns value 2(ERROR_FILE_NOT_FOUND). Here's my code: public class Class1 {
2
2390
by: jerry | last post by:
I'm trying to run an application under another user within a winform app writen in C#. I have tried a number of different things, but it seems that the CreateProcessWithLogonW function should work to do what I need to do. This appears to work just fine in Windows 2000 and XP with service pack 1, but it doesn't work with XP service pack 2 installed. I'm sure it's one of the "Enhanced security features" of service pack 2, but I can't...
2
9365
by: Bilal Dinc | last post by:
Hey, I have a question concerning the CreateProcessWithLogonW function imported from the advapi32 dll. For some reason I cant get the appName and cmdLine paramters to work together. For example, I'm trying to use the Perforce command line utility (p4.exe) to download some files to the local computer. So I set appName="p4.exe" and cmdLine="print -o \"c:\\file.txt\" -q \"//depot/files/file.txt\"". So then I call...
10
5407
by: David Davidson | last post by:
I am attempting to use CreateProcessWithLogonW from the server-side code of a web page (yes, I want to create a process on the server) and not having much luck. I am attempting to run VPScan, an unsupported command-line virus scanner from Symantec, to check an uploaded file for viruses. At first, I wrapped VPScan with a DLL and ran it as a COM+ component and found that it would work only when someone was logged on and it was set to run...
0
1132
by: Todd B | last post by:
Hello, I posted this in the aspnet.security group a few days ago but haven't received any feedback, so I thought I would try this group. Apologies if this is the wrong place. I am developing an ASP.NET application that allows users to enter data using web forms, then run an EXE when they click the appropriate button. The EXE needs certain security rights not available to the ASPNET user.
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.