Manifest file on windows 7 not working

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Manifest file on windows 7 not working

Postby abhinav joshi » Thu Jan 06, 2011 11:18 am

Hi,
In my application I have created a job object and subsequent child process are the part of this job .
In order to add processes to job object I was required to add a manifest file (security attribute) on vista other wise Explorer adds process to its own job and doesnt allow application to add child process in to the application's job object.

This application seems to be working fine when manifest file is added on Vista i.e. all the subsequent processes created are the part of the applcaitin job object,but on Windows 7 this is not working.Here is the manifest file.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Am I missing something in this manifest file for window 7 ?

Thanks in advance..
abhinav joshi
 
Posts: 3
Joined: Thu Jan 06, 2011 11:16 am

Re: Manifest file on windows 7 not working

Postby ventsyv » Thu Jan 06, 2011 11:22 am

It's not working how? What are you seeing ? The only difference between Vista and Win 7 is that the security is much tighter on Win 7.
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA

Re: Manifest file on windows 7 not working

Postby abhinav joshi » Thu Jan 06, 2011 12:56 pm

ventsyv wrote:It's not working how? What are you seeing ? The only difference between Vista and Win 7 is that the security is much tighter on Win 7.


Observations:
Thanks for reply
The process[with manifest file] seems to be the part of explorer job object [ProcExplorer], starting from vista if any application doesn't have manifest file [with security attributes set] explorer adds it to its own job.Once it is the part of explorer job it can not add any other process or child process into a different job object [job created by my application in this case].

On Vista:
The process does not seem to be the part of explorer job in which case it was successfully adding child processes to its job [job object created by my process].This was apparent from ProcExplorer

On Windows 7:
The process is the part of Explorer job, and the process is unable to add child porcess into a different job object.

It seems Windows 7 is simply ignoring the manifest file or may be something is missing .
abhinav joshi
 
Posts: 3
Joined: Thu Jan 06, 2011 11:16 am

Re: Manifest file on windows 7 not working

Postby ventsyv » Fri Jan 07, 2011 1:08 pm

I'm not exactly sure. Here is what I found on MSDN: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Something that I noticed is this: "If you specify NULL, the job object gets a default security descriptor."

There was a change in what the default security descriptor allows from XP to Vista. It's quite possible there was a change in between Vista and 7. I don't think the manifest is the problem. You are embedding it right? I would check the security attributes parameter that's being passed in CreateJobObject ( http://msdn.microsoft.com/en-us/library ... 85%29.aspx )

Can you run the code on Win 7 and step through it?
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA

Re: Manifest file on windows 7 not working

Postby abhinav joshi » Mon Jan 10, 2011 3:55 am

Hi,
Thanks for quick reply,
I think security attributes is not the problem, if the process is already the part of some other job object [Explorer in this case] there is no way to add any subsequent processes created by this process in to a different job object, unless I create new process with job_detach flag set, which is not possible
in my case.

In my application I am creating a process but have no idea how many child this process is going to create

Application(creates job object and adds child to it)
|
V
[child process( source code N/A) ]
|
V
[Grand child 2 ] [Grand child 3 ] [Grand child4] (automatically the part of job)

Here my application Creates a job object but before really creating a job object it finds that it is the part of Explorer job so it is unable to add child
to its job object and its grand children automatically becomes part of Explorer job [viewed in ProcExplore utility].
To avoid this I have used manifest file with security attributes on Vista it worked as expected(not part of explorer job) but on Windows 7 it still shows my application as part of
Explorer Job [ as observed in ProcExplore].
Yes I am embedding my Manifest file into the exe using mt.exe utility.
abhinav joshi
 
Posts: 3
Joined: Thu Jan 06, 2011 11:16 am

Re: Manifest file on windows 7 not working

Postby SteveRegan » Mon Mar 28, 2016 5:08 am

it looks fine, but i guess there is some code to be added to make it compatible fro windows 7. This is because the kernel works in a bit of a different way in windows 7 than in vista. Or try running the same in admin mode. Security attributes mostly creates problem in windows 7, so you have to count on that
SteveRegan
 
Posts: 1
Joined: Mon Mar 28, 2016 5:02 am

Re: Manifest file on windows 7 not working

Postby sandymaria » Thu May 26, 2016 3:22 am

Thanks for sharing such an informative message with us. From this site I got the idea about how a manifest file works on windows. I too faced the similar problem many times. But now I have an idea to solve this problem. cheese curd
sandymaria
 
Posts: 1
Joined: Thu May 26, 2016 3:18 am


Return to Windows Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron