SetSecurityInfo() broken on Windows8?
-
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.
-
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.
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