Changeset 558 for trunk/src/kernel32/KERNEL32.CPP
- Timestamp:
- Aug 18, 1999, 11:54:27 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.CPP
r550 r558 1 /* $Id: KERNEL32.CPP,v 1.1 5 1999-08-18 17:17:59 sandervlExp $ */1 /* $Id: KERNEL32.CPP,v 1.16 1999-08-18 21:54:26 phaller Exp $ */ 2 2 3 3 /* … … 62 62 return HMCloseHandle(hHandle); 63 63 } 64 65 64 66 //****************************************************************************** 65 67 HANDLE WIN32API GetStdHandle(DWORD fdwDevice) … … 191 193 return O32_InterlockedExchange(arg1, arg2); 192 194 } 195 196 197 /************************************************************************ 198 * InterlockedCompareExchange [KERNEL32.879] 199 * 200 * Atomically compares Destination and Comperand, and if found equal exchanges 201 * the value of Destination with Exchange 202 * 203 * RETURNS 204 * Prior value of value pointed to by Destination 205 */ 206 PVOID WIN32API InterlockedCompareExchange( 207 PVOID *Destination, /* Address of 32-bit value to exchange */ 208 PVOID Exchange, /* change value, 32 bits */ 209 PVOID Comperand /* value to compare, 32 bits */ 210 ) { 211 PVOID ret; 212 /* StopAllThreadsAndProcesses() */ 213 214 ret=*Destination; 215 if(*Destination==Comperand) *Destination=Exchange; 216 217 /* ResumeAllThreadsAndProcesses() */ 218 return ret; 219 } 220 221 /************************************************************************ 222 * InterlockedExchangeAdd [KERNEL32.880] 223 * 224 * Atomically adds Increment to Addend and returns the previous value of 225 * Addend 226 * 227 * RETURNS 228 * Prior value of value pointed to by cwAddendTarget 229 */ 230 LONG WIN32API InterlockedExchangeAdd( 231 PLONG Addend, /* Address of 32-bit value to exchange */ 232 LONG Increment /* Value to add */ 233 ) { 234 LONG ret; 235 /* StopAllThreadsAndProcesses() */ 236 237 ret = *Addend; 238 *Addend += Increment; 239 240 /* ResumeAllThreadsAndProcesses() */ 241 return ret; 242 } 243 244 193 245 //****************************************************************************** 194 246 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.