Changeset 21302 for trunk/src/kernel32/kobjects.cpp
- Timestamp:
- Jun 18, 2009, 11:53:26 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/kobjects.cpp
r9748 r21302 31 31 32 32 33 // REMARK: THIS IS IN PREPARATION FOR HANDLEMANAGER SUPPORT (PH) !!34 //#define HMCreateEvent O32_CreateEvent35 //#define HMCreateMutex O32_CreateMutex36 //#define HMCreateSemaphore O32_CreateSemaphore37 //#define HMSetEvent O32_SetEvent38 //#define HMReleaseMutex O32_ReleaseMutex39 //#define HMWaitForSingleObject O32_WaitForSingleObject40 //#define HMWaitForSingleObjectEx O32_WaitForSingleObjectEx41 //#define HMGetOverlappedResult O32_GetOverlappedResult42 //#define HMOpenEvent O32_OpenEvent43 //#define HMOpenMutex O32_OpenMutex44 //#define HMOpenSemaphore O32_OpenSemaphore45 //#define HMPulseEvent O32_PulseEvent46 //#define HMReleaseSemaphore O32_ReleaseSemaphore47 //#define HMResetEvent O32_ResetEvent48 //#define HMWaitForMultipleObjects O32_WaitForMultipleObjects49 //#define HMWaitForMultipleObjectsEx O32_WaitForMultipleObjectsEx50 //#define HMFlushFileBuffers O32_FlushFileBuffers51 #define HMSetHandleCount O32_SetHandleCount52 #define HMGetHandleCount O32_GetHandleCount53 //#define HMDuplicateHandle O32_DuplicateHandle54 55 56 57 33 /***************************************************************************** 58 34 * Defines * … … 64 40 65 41 66 /***************************************************************************** 67 * Name : BOOL CreateEventA 68 * Purpose : forward call to Open32 69 * Parameters: 70 * Variables : 71 * Result : 72 * Remark : 73 * Status : 74 * 75 * Author : Patrick Haller [Fri, 1998/06/12 03:44] 76 *****************************************************************************/ 77 78 HANDLE WIN32API CreateEventA(LPSECURITY_ATTRIBUTES lpsa, BOOL fManualReset, 79 BOOL fInitialState, 80 LPCTSTR lpszEventName) 81 { 82 return(HMCreateEvent(lpsa, /* create event semaphore */ 83 fManualReset, 84 fInitialState, 85 lpszEventName)); 86 } 87 88 89 /***************************************************************************** 90 * Name : BOOL CreateEventW 91 * Purpose : forward call to Open32 92 * Parameters: 93 * Variables : 94 * Result : 95 * Remark : handle translation is done in CreateEventA 96 * Status : 97 * 98 * Author : Patrick Haller [Fri, 1998/06/12 03:44] 99 *****************************************************************************/ 100 101 HANDLE WIN32API CreateEventW(LPSECURITY_ATTRIBUTES arg1, 102 BOOL arg2, BOOL arg3, 103 LPCWSTR arg4) 104 { 105 HANDLE rc; 106 char *astring; 107 108 if (arg4 != NULL) // support for unnamed semaphores 109 astring = UnicodeToAsciiString((LPWSTR)arg4); 110 else 111 astring = NULL; 112 113 dprintf(("KERNEL32: CreateEventW(%s)\n", 114 astring)); 115 116 rc = HMCreateEvent(arg1, 117 arg2, 118 arg3, 119 astring); 120 121 if (astring != NULL) 122 FreeAsciiString(astring); 123 124 return(rc); 125 } 126 127 128 /***************************************************************************** 129 * Name : BOOL CreateMutexA 130 * Purpose : forward call to Open32 131 * Parameters: 132 * Variables : 133 * Result : 134 * Remark : handle translation is done in CreateMutexA 135 * Status : 136 * 137 * Author : Patrick Haller [Fri, 1999/06/18 03:44] 138 *****************************************************************************/ 139 140 HANDLE WIN32API CreateMutexA(LPSECURITY_ATTRIBUTES lpsa, 141 BOOL fInitialOwner, 142 LPCTSTR lpszMutexName) 143 { 144 dprintf(("KERNEL32: CreateMutexA(%s)\n", 145 lpszMutexName)); 146 147 return(HMCreateMutex(lpsa, 148 fInitialOwner, 149 lpszMutexName)); 150 } 42 43 151 44 152 45 … … 174 67 astring = NULL; 175 68 176 dprintf(("KERNEL32: CreateMutexW(%s)\n", 177 astring)); 178 179 rc = HMCreateMutex(arg1, 69 rc = CreateMutexA(arg1, 180 70 arg2, 181 71 astring); … … 185 75 186 76 return(rc); 187 }188 189 190 /*****************************************************************************191 * Name : BOOL ReleaseMutex192 * Purpose : forward call to Open32193 * Parameters:194 * Variables :195 * Result :196 * Remark : handle translation is done in ReleaseMutex197 * Status :198 *199 * Author : Patrick Haller [Fri, 1999/06/18 03:44]200 *****************************************************************************/201 202 BOOL WIN32API ReleaseMutex(HANDLE mutex)203 {204 return(HMReleaseMutex(mutex));205 }206 207 208 /*****************************************************************************209 * Name : BOOL SetEvent210 * Purpose : forward call to Open32211 * Parameters:212 * Variables :213 * Result :214 * Remark : handle translation is done in SetEvent215 * Status :216 *217 * Author : Patrick Haller [Fri, 1999/06/18 03:44]218 *****************************************************************************/219 220 BOOL WIN32API SetEvent(HANDLE hEvent)221 {222 return(HMSetEvent(hEvent));223 77 } 224 78 … … 274 128 } 275 129 276 277 /*****************************************************************************278 * Name : BOOL FlushFileBuffers279 * Purpose : forward call to Open32280 * Parameters:281 * Variables :282 * Result :283 * Remark : handle translation is done in FlushFileBuffers284 * Status :285 *286 * Author : Patrick Haller [Fri, 1999/06/18 03:44]287 *****************************************************************************/288 289 BOOL WIN32API FlushFileBuffers(HANDLE hFile)290 {291 return(HMFlushFileBuffers(hFile));292 }293 130 294 131 … … 351 188 352 189 353 /*****************************************************************************354 * Name : BOOL CreateSemaphoreA355 * Purpose : forward call to Open32356 * Parameters:357 * Variables :358 * Result :359 * Remark : handle translation is done in CreateSemaphoreA360 * Status :361 *362 * Author : Patrick Haller [Fri, 1999/06/18 03:44]363 *****************************************************************************/364 365 HANDLE WIN32API CreateSemaphoreA(LPSECURITY_ATTRIBUTES arg1,366 LONG arg2, LONG arg3, LPCSTR arg4)367 {368 return HMCreateSemaphore(arg1,369 arg2,370 arg3,371 (LPSTR)arg4);372 }373 374 190 375 191 /***************************************************************************** … … 396 212 astring = NULL; 397 213 398 dprintf(("KERNEL32: CreateSemaphoreW(%s)\n", 399 astring)); 400 401 rc = HMCreateSemaphore(arg1, 214 rc = CreateSemaphoreA(arg1, 402 215 arg2, 403 216 arg3, … … 409 222 } 410 223 411 /*****************************************************************************412 * Name : BOOL OpenEventA413 * Purpose : forward call to Open32414 * Parameters:415 * Variables :416 * Result :417 * Remark : handle translation is done in OpenEventA418 * Status :419 *420 * Author : Patrick Haller [Fri, 1999/06/18 03:44]421 *****************************************************************************/422 423 HANDLE WIN32API OpenEventA(DWORD arg1, BOOL arg2, LPCSTR arg3)424 {425 dprintf(("KERNEL32: OpenEventA(%s)\n",426 arg3));427 428 return HMOpenEvent(arg1,429 arg2,430 arg3);431 }432 433 224 434 225 /***************************************************************************** … … 452 243 asciiname = UnicodeToAsciiString((LPWSTR)lpName); 453 244 454 dprintf(("KERNEL32: OpenEventW(%s)\n", 455 asciiname)); 456 457 rc = HMOpenEvent(dwDesiredAccess, 245 rc = OpenEventA(dwDesiredAccess, 458 246 bInheritHandle, 459 247 asciiname); … … 464 252 465 253 /***************************************************************************** 466 * Name : BOOL OpenMutexA467 * Purpose : forward call to Open32468 * Parameters:469 * Variables :470 * Result :471 * Remark : handle translation is done in OpenMutexA472 * Status :473 *474 * Author : Patrick Haller [Fri, 1999/06/18 03:44]475 *****************************************************************************/476 477 HANDLE WIN32API OpenMutexA(DWORD arg1, BOOL arg2, LPCSTR arg3)478 {479 dprintf(("KERNEL32: OpenMutexA(%s)\n",480 arg3));481 482 return HMOpenMutex(arg1,483 arg2,484 arg3);485 }486 487 488 /*****************************************************************************489 254 * Name : BOOL OpenMutexW 490 255 * Purpose : forward call to Open32 … … 506 271 asciiname = UnicodeToAsciiString((LPWSTR)lpName); 507 272 508 dprintf(("KERNEL32: OpenMutexW(%s)\n", 509 asciiname)); 510 511 rc = HMOpenMutex(dwDesiredAccess, 273 rc = OpenMutexA(dwDesiredAccess, 512 274 bInheritHandle, 513 275 asciiname); … … 518 280 519 281 /***************************************************************************** 520 * Name : BOOL OpenSemaphoreA521 * Purpose : forward call to Open32522 * Parameters:523 * Variables :524 * Result :525 * Remark : handle translation is done in OpenSemaphoreA526 * Status :527 *528 * Author : Patrick Haller [Fri, 1999/06/18 03:44]529 *****************************************************************************/530 531 HANDLE WIN32API OpenSemaphoreA(DWORD arg1, BOOL arg2, LPCSTR arg3)532 {533 dprintf(("KERNEL32: OpenSemaphoreA(%s)\n",534 arg3));535 536 return HMOpenSemaphore(arg1,537 arg2,538 arg3);539 }540 541 542 /*****************************************************************************543 282 * Name : BOOL OpenSemaphoreW 544 283 * Purpose : forward call to Open32 … … 560 299 asciiname = UnicodeToAsciiString((LPWSTR)lpName); 561 300 562 dprintf(("KERNEL32: OpenSemaphoreW(%s)\n", 563 asciiname)); 564 565 rc = HMOpenSemaphore(dwDesiredAccess, 301 rc = OpenSemaphoreA(dwDesiredAccess, 566 302 bInheritHandle, 567 303 asciiname); … … 570 306 } 571 307 572 573 /*****************************************************************************574 * Name : BOOL PulseEvent575 * Purpose : forward call to Open32576 * Parameters:577 * Variables :578 * Result :579 * Remark : handle translation is done in PulseEvent580 * Status :581 *582 * Author : Patrick Haller [Fri, 1999/06/18 03:44]583 *****************************************************************************/584 585 BOOL WIN32API PulseEvent(HANDLE arg1)586 {587 return HMPulseEvent(arg1);588 }589 590 591 /*****************************************************************************592 * Name : BOOL ReleaseSemaphore593 * Purpose : forward call to Open32594 * Parameters:595 * Variables :596 * Result :597 * Remark : handle translation is done in ReleaseSemaphore598 * Status :599 *600 * Author : Patrick Haller [Fri, 1999/06/18 03:44]601 *****************************************************************************/602 603 BOOL WIN32API ReleaseSemaphore(HANDLE arg1, LONG arg2, PLONG arg3)604 {605 return HMReleaseSemaphore(arg1,606 arg2,607 arg3);608 }609 610 611 /*****************************************************************************612 * Name : BOOL ResetEvent613 * Purpose : forward call to Open32614 * Parameters:615 * Variables :616 * Result :617 * Remark : handle translation is done in ResetEvent618 * Status :619 *620 * Author : Patrick Haller [Fri, 1999/06/18 03:44]621 *****************************************************************************/622 623 BOOL WIN32API ResetEvent(HANDLE arg1)624 {625 return HMResetEvent(arg1);626 }627 308 628 309 … … 706 387 //****************************************************************************** 707 388 //****************************************************************************** 708 HANDLE WIN32API CreateThread(LPSECURITY_ATTRIBUTES lpsa,709 DWORD cbStack,710 LPTHREAD_START_ROUTINE lpStartAddr,711 LPVOID lpvThreadParm,712 DWORD fdwCreate,713 LPDWORD lpIDThread)714 {715 return HMCreateThread(lpsa, cbStack, lpStartAddr, lpvThreadParm, fdwCreate, lpIDThread);716 }717 //******************************************************************************718 //******************************************************************************719 INT WIN32API GetThreadPriority(HANDLE hThread)720 {721 return HMGetThreadPriority(hThread);722 }723 //******************************************************************************724 //******************************************************************************725 DWORD WIN32API SuspendThread(HANDLE hThread)726 {727 return HMSuspendThread(hThread);728 }729 //******************************************************************************730 //******************************************************************************731 BOOL WIN32API SetThreadPriority(HANDLE hThread, int priority)732 {733 return HMSetThreadPriority(hThread, priority);734 }735 //******************************************************************************736 //******************************************************************************737 BOOL WIN32API GetThreadContext(HANDLE hThread, PCONTEXT lpContext)738 {739 return HMGetThreadContext(hThread, lpContext);740 }741 //******************************************************************************742 //******************************************************************************743 BOOL WIN32API SetThreadContext(HANDLE hThread, const CONTEXT *lpContext)744 {745 return HMSetThreadContext(hThread, lpContext);746 }747 //******************************************************************************748 //******************************************************************************749 BOOL WIN32API GetThreadTimes(HANDLE hThread,750 LPFILETIME lpCreationTime,751 LPFILETIME lpExitTime,752 LPFILETIME lpKernelTime,753 LPFILETIME lpUserTime)754 {755 return HMGetThreadTimes(hThread, lpCreationTime, lpExitTime, lpKernelTime, lpUserTime);756 }757 //******************************************************************************758 //******************************************************************************759 BOOL WIN32API TerminateThread(HANDLE hThread, DWORD exitcode)760 {761 return HMTerminateThread(hThread, exitcode);762 }763 //******************************************************************************764 //******************************************************************************765 DWORD WIN32API ResumeThread(HANDLE hThread)766 {767 return HMResumeThread(hThread);768 }769 //******************************************************************************770 //******************************************************************************771 BOOL WIN32API GetExitCodeThread(HANDLE hThread, LPDWORD arg2)772 {773 return HMGetExitCodeThread(hThread, arg2);774 }775 //******************************************************************************776 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.