Changeset 7532 for trunk/src/kernel32/hmthread.cpp
- Timestamp:
- Dec 3, 2001, 1:13:10 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmthread.cpp
r5920 r7532 1 /* $Id: hmthread.cpp,v 1. 8 2001-06-06 18:59:57 phallerExp $ */1 /* $Id: hmthread.cpp,v 1.9 2001-12-03 12:13:08 sandervl Exp $ */ 2 2 3 3 /* … … 21 21 #include <string.h> 22 22 #include <misc.h> 23 #include <wprocess.h> 23 24 24 25 #include <HandleManager.H> 25 26 #include "HMThread.h" 27 #include "oslibdos.h" 26 28 27 29 #include <win\thread.h> … … 61 63 winthread = new Win32Thread(lpStartAddr, lpvThreadParm, fdwCreate, pHMHandleData->hHMHandle); 62 64 63 if(winthread == 0) 64 return(0); 65 65 if(winthread == 0) { 66 SetLastError(ERROR_NOT_ENOUGH_MEMORY); 67 return(0); 68 } 66 69 // @@@PH Note: with debug code enabled, ODIN might request more stack space! 67 70 //SvL: Also need more stack in release build (RealPlayer 7 sometimes runs … … 85 88 //****************************************************************************** 86 89 //****************************************************************************** 87 INT HMDeviceThreadClass::GetThreadPriority(PHMHANDLEDATA pHMHandleData) 88 { 90 DWORD HMDeviceThreadClass::SuspendThread(HANDLE hThread, PHMHANDLEDATA pHMHandleData) 91 { 92 dprintf(("SuspendThread %08xh)\n", pHMHandleData->hHMHandle)); 93 94 return O32_SuspendThread(pHMHandleData->hHMHandle); 95 } 96 //****************************************************************************** 97 //****************************************************************************** 98 INT HMDeviceThreadClass::GetThreadPriority(HANDLE hThread, PHMHANDLEDATA pHMHandleData) 99 { 100 TEB *teb; 101 89 102 dprintf(("GetThreadPriority(%08xh)\n", pHMHandleData->hHMHandle)); 90 103 91 return O32_GetThreadPriority(pHMHandleData->hHMHandle); 92 } 93 //****************************************************************************** 94 //****************************************************************************** 95 DWORD HMDeviceThreadClass::SuspendThread(PHMHANDLEDATA pHMHandleData) 96 { 97 dprintf(("SuspendThread %08xh)\n", pHMHandleData->hHMHandle)); 98 99 return O32_SuspendThread(pHMHandleData->hHMHandle); 100 } 101 //****************************************************************************** 102 //****************************************************************************** 103 BOOL HMDeviceThreadClass::SetThreadPriority(PHMHANDLEDATA pHMHandleData, int priority) 104 { 105 dprintf(("SetThreadPriority (%08xh,%08xh)\n", 106 pHMHandleData->hHMHandle, 107 priority)); 108 109 return O32_SetThreadPriority(pHMHandleData->hHMHandle, priority); 104 teb = GetTEBFromThreadHandle(hThread); 105 if(teb == NULL) { 106 dprintf(("!WARNING!: TEB not found!!")); 107 SetLastError(ERROR_INVALID_HANDLE); 108 return THREAD_PRIORITY_ERROR_RETURN; 109 } 110 return teb->delta_priority; 111 } 112 //****************************************************************************** 113 //****************************************************************************** 114 BOOL HMDeviceThreadClass::SetThreadPriority(HANDLE hThread, PHMHANDLEDATA pHMHandleData, int priority) 115 { 116 TEB *teb; 117 118 dprintf(("SetThreadPriority (%08xh,%08xh)", pHMHandleData->hHMHandle, priority)); 119 120 teb = GetTEBFromThreadHandle(hThread); 121 if(teb == NULL) { 122 dprintf(("!WARNING!: TEB not found!!")); 123 SetLastError(ERROR_INVALID_HANDLE); 124 return THREAD_PRIORITY_ERROR_RETURN; 125 } 126 DWORD ret = OSLibDosSetPriority(teb->o.odin.threadId, priority); 127 if(ret == ERROR_SUCCESS) { 128 teb->delta_priority = priority; 129 return TRUE; 130 } 131 else { 132 dprintf(("DosSetPriority failed with rc %d", ret)); 133 return FALSE; 134 } 110 135 } 111 136 //****************************************************************************** 112 137 //TODO: Implement this?? 113 138 //****************************************************************************** 114 BOOL HMDeviceThreadClass::GetThreadContext( PHMHANDLEDATA pHMHandleData, PCONTEXT lpContext)139 BOOL HMDeviceThreadClass::GetThreadContext(HANDLE hThread, PHMHANDLEDATA pHMHandleData, PCONTEXT lpContext) 115 140 { 116 141 dprintf(("GetThreadContext NOT IMPLEMENTED!! (TRUE)\n")); … … 130 155 //TODO: Implement this?? 131 156 //****************************************************************************** 132 BOOL HMDeviceThreadClass::SetThreadContext( PHMHANDLEDATA pHMHandleData, const CONTEXT *lpContext)157 BOOL HMDeviceThreadClass::SetThreadContext(HANDLE hThread, PHMHANDLEDATA pHMHandleData, const CONTEXT *lpContext) 133 158 { 134 159 dprintf(("SetThreadContext NOT IMPLEMENTED!!\n")); … … 138 163 //****************************************************************************** 139 164 //****************************************************************************** 140 BOOL HMDeviceThreadClass::TerminateThread( PHMHANDLEDATA pHMHandleData, DWORD exitcode)165 BOOL HMDeviceThreadClass::TerminateThread(HANDLE hThread, PHMHANDLEDATA pHMHandleData, DWORD exitcode) 141 166 { 142 167 dprintf(("TerminateThread (%08xh,%08xh)\n", … … 149 174 //****************************************************************************** 150 175 //****************************************************************************** 151 BOOL HMDeviceThreadClass::SetThreadTerminated( PHMHANDLEDATA pHMHandleData)176 BOOL HMDeviceThreadClass::SetThreadTerminated(HANDLE hThread, PHMHANDLEDATA pHMHandleData) 152 177 { 153 178 pHMHandleData->dwUserData = THREAD_TERMINATED; … … 156 181 //****************************************************************************** 157 182 //****************************************************************************** 158 DWORD HMDeviceThreadClass::ResumeThread( PHMHANDLEDATA pHMHandleData)183 DWORD HMDeviceThreadClass::ResumeThread(HANDLE hThread, PHMHANDLEDATA pHMHandleData) 159 184 { 160 185 dprintf(("ResumeThread (%08xh)\n", … … 165 190 //****************************************************************************** 166 191 //****************************************************************************** 167 BOOL HMDeviceThreadClass::GetExitCodeThread( PHMHANDLEDATA pHMHandleData, LPDWORD lpExitCode)192 BOOL HMDeviceThreadClass::GetExitCodeThread(HANDLE hThread, PHMHANDLEDATA pHMHandleData, LPDWORD lpExitCode) 168 193 { 169 194 dprintf(("GetExitCodeThread (%08xh,%08xh)\n",
Note:
See TracChangeset
for help on using the changeset viewer.