News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

System Settings Stub files

Started by hutch--, February 15, 2020, 11:33:36 PM

Previous topic - Next topic

jimg

Thanks guys.

Hutch-
When I right-click my program and run as administrator it doesn't work.
When I run your program it only works if I right-click run as administrator.  But that's real progress to me! 

AW- The administrator thing is the key alright.

Now to figure out how to elevate the permissions when launching from a program that has been run from the desktop context menu.

I've been using winexec because I had the choice between-

      invoke WinExec,addr cmdbuf,SW_HIDE

or

      local ssi:STARTUPINFO,pi:PROCESS_INFORMATION
      invoke RtlZeroMemory,addr ssi,sizeof ssi
      mov ssi.cb,sizeof ssi
      invoke RtlZeroMemory,addr pi,sizeof pi
      invoke CreateProcess,0,addr cmdbuf,0,0,1,0,0,0,addr ssi,addr pi

didn't seem like a hard decision to me.

jimg

And now to sound really dumb.   What is exec?   I searched masm32 and could not find it.

jimg

AW-
I went back and compiled Vortex's program and it works exactly as you said, run as administrator worked.

I'll still have to figure out how to raise the level when I launch it from a normal program that is launched from the desktop context menu.   It seems odd that msconfig works fine from a non-administrator command window, or from the windowskey+R window, but not from a program.

aw27

Quote
It seems odd that msconfig works fine from a non-administrator command window, or from the windowskey+R window, but not from a program

Some programs run elevated, without requiring UAC, when the user belongs to the Administrator's group (i.e, even if the account is not the Administrator account). These programs have "autoElevate=true" in the manifest.
This does not apply to launching from applications.


Vortex

Hi Jim,

Just like AW said, you have to run the application as administrator. Today, I tested in on a fresh Windows 10 64-bit installation and it worked.

hutch--

Jim,

The example was 64 bit MASM and the macro "exec" is just a wrapper for CreateProcess(). I have my dev box set to no UAC as I find its a pest that interferes with some of what I do.

jimg

Thanks guys.  I think I've beat this dead horse enough.