mdschwarz


I'm working on migrating a driver management application (written in Visual C++) to Vista. It requires access to HKLM, so it needs to run with admin access permissions. For testing purposes, we've been modifying secpol.msc to run it in admin approved mode, but obviously, that's not the right thing to do.

The right thing to do, from what I can tell, is to add a <trustInfo> tag to the application manifest (which is embedded in the .exe as a resource). I did that, but now the application fails to start under Vista at all, with the error message "A referral was returned from the server." It still works fine under XP.

The manifest is pasted below. Does anything look obviously incorrect If not, is there anything that could interact badly with the <trustInfo> setting to cause that error

Edit: This was under RC1, in case it makes a difference.

Thanks,
David

---------------------------------------------------------------

< xml version="1.0" encoding="UTF-8" standalone="yes" >
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.DriverMan"
type="win32"
/>
<description>Your app description here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="true"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>



Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

alexander5245

Hi David,

I'm running into this too. Have you found a solution

Thanks,
Bob




Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Dannyboy13

The same thing happens to me with an external manifest file, so it seems like something is off with the manifest file itself. I have another much simpler program (all it does is attempt to remove a key from the HKLM area of the registry) that I wrote to test manifests that still works though, so I know that they do, in fact, work ... at least occassionally.




Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

alexander5245

Hi Daniel,

I presume the manifest on the small program that works is the same as the manifest on the big program that doesn't

It might help if we knew what a referral was and/or which server was returning it. It seems implausible that the manifest would force an internet access, so the server must be local. Is it a background process Is it running on some systems and not others Has it crashed

To test whether it crashed, could you try running you program that fails, then your program that works If a server has crashed in response to the first program, it should still be crashed for the second.

- Bob




Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

King Lemur


I got by this problem by changing the "uiAccess" parameter from "true" to "false." I have another, smaller program where the manifest with uiAccess="true" works with no problem. Apparently, this has something to do with the "User Account Control: Only elevate UIAccess applications that are in secure locations" option in secpol.msc.

The "A referral was returned from the server" error seems to be how Vista responds to UAC denials. If I enable the "User Account Control: Only elevate executables that are signed and validated" option and try either of my applications, I get the same error.

It'd be really nice for developers if Vista actually gave UAC error messages for UAC-related failures...

David




Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Dannyboy13

This is the entirety of both manifests, one works, the other throws that error.

< xml version="1.0" encoding="UTF-8" standalone="yes" >
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Program Name"
type="win32"/>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

I should note that I receive the error prior to getting the elevation prompt and that I've had problems even getting a manifest to work with the program in question, so the issue may be something else. I'll admit that I'm new to manifests and I'm uncertain which elements are absolutely necessary and which ones are not. Frankly, I'd prefer to have the bare minimum required in the manifest for starters for the sake of ease :).

I have been trying to remotely debug the issue as well, to no avail as of yet but I will continue to forge ahead in hopes of stumbling across the answer (unless one presents itself here first).

Cheers,

Daniel






Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Dannyboy13

I was mistaken, the above manifest works, but when I change the uiAccess="false" to uiAccess="true" it throws the referral error. That is the only difference between the two manifests.

< xml version="1.0" encoding="UTF-8" standalone="yes" >
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Program Name"
type="win32"/>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Works for my program

< xml version="1.0" encoding="UTF-8" standalone="yes" >
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Program Name"
type="win32"/>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="true"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Does NOT work for my program.

That seems to be an issue with UAC more than an issue with the program itself.

Cheers,

Daniel






Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Dannyboy13

I did a google search for the error and it linked me to an msdn page with results for Lightweight Directory Access Protocol applications.

http://windowssdk.msdn.microsoft.com/en-us/library/ms693297.aspx

I'm not sure how much this helps or if it is even applicable as I'm not aware that the program I'm dealing with does anything like that. Ironically when I remotely debug the application using the offending manifest things work fine.

- Daniel






Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Rasmus Christian Kaae

Reading the requirements for the Windows Vista Logo Program I found the following concerning the use of "uiaccess" :

"Applications that need to drive the input of the UI of another window may set uiAccesss=true, but will also need to apply for a waiver. Only accessibility applications will be considered for this waiver."

So my guess is that even though you write an MFC GUI application you will need to set this value to false, unless you write accessibility applications (which I don't).





Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Dannyboy13

Well, more manifest issues for me :(.

I just did a new build of my application and installed it onto Vista RC2. The only known changes made were to a small section of code that was throwing errors when run on Vista, so I basically removed the functionality until I have more time to properly debug it. That being said, the manifest that was finally working with the last successful build and install of the software is now not working with the latest build.

Does anyone have any clue as to why this might be The version number between the two didn't change any and I haven't added any internal manifests to the exe that might override my external manifest file, so I don't think that is the cause.

As always, any help would be greatly appreciated.

Cheers,

Daniel






Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

MFred

Hi,

I run in the same problem.
Just to be sure, I do the things right, I've tried with notepad.exe.
When I add a manifest+sign with "requireAdministrator" but withtout uiAccess Attribute (or with uiAccess set to false), I get the prompt, ... and notepad works well.
BUT, if I add a manifest+sign with "requireAdministrator" AND uiAccess set to "true", I recieve always "A referral was returned from the server". No prompt for admin-rights, only "A referral was returned from the server".
Could someone help
Where are the microsoft vista gurus !

Thx




Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Rasmus Christian Kaae

My immediate response is that you never need the "uiAccess" to be set to "true". Atleast I have not encountered a need for it.



Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

MFred

Sorry Rasmus Christian Kaae, but I DO need uiAccess="true" even 99% of the applications don't need it!!

I could also say, if this flag exists, then it must be useful, else it wouldn't exist!





Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

Rasmus Christian Kaae

"I could also say, if this flag exists, then it must be useful, else it wouldn't exist!"

Or it is just a hack from the MS-development team. Out of curriosity, why do you need to access the GUI of another running application





Re: General Windows Vista Development Issues Application fails to start under Vista: "A referral was returned from the server." Manifest problem?

MFred

Hi,

Well, it's very simple.

I'm trying to make Visual Test run under Vista!!! That's why I DO need that this flag works.

I can find everywhere, also by microsoft, that this flag exists, what it does, ... but it seems, it doesn't work properly. Did I find the "first" bug in Vista ! !

If you want to automate tests for an application, then it's exactly what you need. You have to control the GUI of another application through your test-software.