Author Topic: System Settings Stub files  (Read 4175 times)

jimg

  • Member
  • ***
  • Posts: 468
Re: System Settings Stub files
« Reply #15 on: February 19, 2020, 02:15:26 AM »
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

  • Member
  • ***
  • Posts: 468
Re: System Settings Stub files
« Reply #16 on: February 19, 2020, 02:20:55 AM »
And now to sound really dumb.   What is exec?   I searched masm32 and could not find it.

jimg

  • Member
  • ***
  • Posts: 468
Re: System Settings Stub files
« Reply #17 on: February 19, 2020, 02:34:27 AM »
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

  • Guest
Re: System Settings Stub files
« Reply #18 on: February 19, 2020, 03:04:23 AM »
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

  • Member
  • *****
  • Posts: 2593
Re: System Settings Stub files
« Reply #19 on: February 19, 2020, 04:46:30 AM »
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--

  • Administrator
  • Member
  • ******
  • Posts: 8568
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: System Settings Stub files
« Reply #20 on: February 19, 2020, 05:26:47 AM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jimg

  • Member
  • ***
  • Posts: 468
Re: System Settings Stub files
« Reply #21 on: February 19, 2020, 06:06:16 AM »
Thanks guys.  I think I've beat this dead horse enough.