473,788 Members | 2,692 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 787

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
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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
8993
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...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.