Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. SetSecurityInfo() broken on Windows8?

SetSecurityInfo() broken on Windows8?

Scheduled Pinned Locked Moved Windows API
helpquestion
2 Posts 2 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    This works on WIndows 7:

    HANDLE h;

    h = CreateThread(NULL,
    					0, 
    					&TestThread,		// thread function
    					this,				// thread argument
    					CREATE\_SUSPENDED,	// creation option
    					0);
    
    
    m\_ThreadGo = TRUE;
    
    if(ERROR\_SUCCESS != SetSecurityInfo(h, SE\_KERNEL\_OBJECT, THREAD\_SET\_INFORMATION | THREAD\_QUERY\_INFORMATION, NULL, NULL, NULL, NULL))
    {
    	doerror();
    	OutputDebugString("SetSecurityInfo failed\\n");
    }
    

    On Windows 8 it gives "Access denied", on Windows 7 it succeeds. Both are run as admin. Secondly, SetThreadAffinityMask() doesnt report an error, but it doesnt work. The created thread jumps arond the CPUs. Looks like a bug in windows 8 to me since there isnt any documented change for WIndows8 that I can find. Anyone else seen this?

    ============================== Nothing to say.

    D 1 Reply Last reply
    0
    • L Lost User

      This works on WIndows 7:

      HANDLE h;

      h = CreateThread(NULL,
      					0, 
      					&TestThread,		// thread function
      					this,				// thread argument
      					CREATE\_SUSPENDED,	// creation option
      					0);
      
      
      m\_ThreadGo = TRUE;
      
      if(ERROR\_SUCCESS != SetSecurityInfo(h, SE\_KERNEL\_OBJECT, THREAD\_SET\_INFORMATION | THREAD\_QUERY\_INFORMATION, NULL, NULL, NULL, NULL))
      {
      	doerror();
      	OutputDebugString("SetSecurityInfo failed\\n");
      }
      

      On Windows 8 it gives "Access denied", on Windows 7 it succeeds. Both are run as admin. Secondly, SetThreadAffinityMask() doesnt report an error, but it doesnt work. The created thread jumps arond the CPUs. Looks like a bug in windows 8 to me since there isnt any documented change for WIndows8 that I can find. Anyone else seen this?

      ============================== Nothing to say.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      SORRY! I just re-read the subject line... :doh: The only thing I can think of is that the security options you've OR'd together may need to be modified to include something else. I'd try the call to SetSecurityInfo with THREAD_ALL_ACCESS to see if that works first.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups