Creating thread with security attributes

  • Thread starter Thread starter CuffCode
  • Start date Start date
C

CuffCode

Guest
MYDATA mdat = {pid, data_size};

SECURITY_ATTRIBUTES SA;

SA.nLength = sizeof(SECURITY_ATTRIBUTES);

SA.lpSecurityDescriptor = THREAD_ALL_ACCESS;

SA.bInheritHandle = TRUE;

//HANDLE curThr = CreateThread(&SA, 0, solo_thread, &mdat, 0, &threadId[0]);
HANDLE curThr = _beginthreadex(&SA, 0, solo_thread, &mdat, 0, &threadId[0]);

Handle curThr always fails to create the thread, GetLastError() gives a code 998 error.

ERROR_NOACCESS


998 (0x3E6)


Invalid access to memory location.

Continue reading...
 
Back
Top