syscall.h 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627
  1. /*++
  2. Copyright (c) 2013 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. syscall.h
  9. Abstract:
  10. This header contains definitions for the kernel interface to user-mode.
  11. Author:
  12. Evan Green 6-Feb-2013
  13. --*/
  14. //
  15. // ------------------------------------------------------------------- Includes
  16. //
  17. //
  18. // --------------------------------------------------------------------- Macros
  19. //
  20. //
  21. // This macro determines whether or not a system call is eligible for being
  22. // restarted based on its system call number.
  23. //
  24. #define IS_SYSTEM_CALL_NUMBER_RESTARTABLE(_SystemCallNumber) \
  25. (((_SystemCallNumber) != SystemCallRestoreContext) && \
  26. ((_SystemCallNumber) != SystemCallExecuteImage))
  27. //
  28. // This macro determines whether or not a system call is eligible for being
  29. // restarted based on its result.
  30. //
  31. #define IS_SYSTEM_CALL_RESULT_RESTARTABLE(_SystemCallResult) \
  32. (((_SystemCallResult) == STATUS_RESTART_AFTER_SIGNAL) || \
  33. ((_SystemCallResult) == STATUS_RESTART_NO_SIGNAL))
  34. //
  35. // This macro determines whether or not a system call is eligible for being
  36. // restarted after a signal is dispatched based on its result.
  37. //
  38. #define IS_SYSTEM_CALL_RESULT_RESTARTABLE_AFTER_SIGNAL(_SystemCallResult) \
  39. ((_SystemCallResult) == STATUS_RESTART_AFTER_SIGNAL)
  40. //
  41. // This macro determines whether or not a signal call is eligible for being
  42. // restarted if no signal is applied based on its result.
  43. //
  44. #define IS_SYSTEM_CALL_RESULT_RESTARTABLE_NO_SIGNAL(_SystemCallResult) \
  45. IS_SYSTEM_CALL_RESULT_RESTARTABLE(_SystemCallResult)
  46. //
  47. // ---------------------------------------------------------------- Definitions
  48. //
  49. //
  50. // Define the attributes applied to all system call structures (namely
  51. // alignment for fast copies).
  52. //
  53. #define SYSCALL_STRUCT ALIGNED64
  54. #define SYS_WAIT_TIME_INDEFINITE MAX_ULONG
  55. #define SYS_WAIT_TIME_MAX (MAX_ULONG - 1)
  56. //
  57. // Define open flags.
  58. //
  59. #define SYS_OPEN_FLAG_CREATE 0x00000001
  60. #define SYS_OPEN_FLAG_TRUNCATE 0x00000002
  61. #define SYS_OPEN_FLAG_FAIL_IF_EXISTS 0x00000004
  62. #define SYS_OPEN_FLAG_APPEND 0x00000008
  63. #define SYS_OPEN_FLAG_DIRECTORY 0x00000010
  64. #define SYS_OPEN_FLAG_NON_BLOCKING 0x00000020
  65. #define SYS_OPEN_FLAG_SHARED_MEMORY 0x00000040
  66. #define SYS_OPEN_FLAG_NO_SYMBOLIC_LINK 0x00000080
  67. #define SYS_OPEN_FLAG_SYNCHRONIZED 0x00000100
  68. #define SYS_OPEN_FLAG_NO_CONTROLLING_TERMINAL 0x00000200
  69. #define SYS_OPEN_FLAG_NO_ACCESS_TIME 0x00000400
  70. #define SYS_OPEN_FLAG_ASYNCHRONOUS 0x00000800
  71. #define SYS_OPEN_ACCESS_SHIFT 29
  72. #define SYS_OPEN_FLAG_READ (IO_ACCESS_READ << SYS_OPEN_ACCESS_SHIFT)
  73. #define SYS_OPEN_FLAG_WRITE (IO_ACCESS_WRITE << SYS_OPEN_ACCESS_SHIFT)
  74. #define SYS_OPEN_FLAG_EXECUTE (IO_ACCESS_EXECUTE << SYS_OPEN_ACCESS_SHIFT)
  75. #define SYS_OPEN_FLAG_CLOSE_ON_EXECUTE 0x10000000
  76. //
  77. // Define the mask of system call open flags that get translated directly to
  78. // kernel open flags.
  79. //
  80. #define SYS_OPEN_FLAG_MASK \
  81. (SYS_OPEN_FLAG_CREATE | \
  82. SYS_OPEN_FLAG_TRUNCATE | \
  83. SYS_OPEN_FLAG_FAIL_IF_EXISTS | \
  84. SYS_OPEN_FLAG_APPEND | \
  85. SYS_OPEN_FLAG_DIRECTORY | \
  86. SYS_OPEN_FLAG_NON_BLOCKING | \
  87. SYS_OPEN_FLAG_SHARED_MEMORY | \
  88. SYS_OPEN_FLAG_NO_SYMBOLIC_LINK | \
  89. SYS_OPEN_FLAG_SYNCHRONIZED | \
  90. SYS_OPEN_FLAG_NO_CONTROLLING_TERMINAL | \
  91. SYS_OPEN_FLAG_NO_ACCESS_TIME | \
  92. SYS_OPEN_FLAG_ASYNCHRONOUS)
  93. #define SYS_FILE_CONTROL_EDITABLE_STATUS_FLAGS \
  94. (SYS_OPEN_FLAG_APPEND | \
  95. SYS_OPEN_FLAG_NON_BLOCKING | \
  96. SYS_OPEN_FLAG_SYNCHRONIZED | \
  97. SYS_OPEN_FLAG_NO_ACCESS_TIME | \
  98. SYS_OPEN_FLAG_ASYNCHRONOUS)
  99. //
  100. // Define delete flags.
  101. //
  102. #define SYS_DELETE_FLAG_SHARED_MEMORY 0x00000001
  103. #define SYS_DELETE_FLAG_DIRECTORY 0x00000002
  104. //
  105. // Define mount flags.
  106. //
  107. #define SYS_MOUNT_FLAG_UNMOUNT 0x00000001
  108. #define SYS_MOUNT_FLAG_BIND 0x00000002
  109. #define SYS_MOUNT_FLAG_RECURSIVE 0x00000004
  110. #define SYS_MOUNT_FLAG_READ 0x00000008
  111. #define SYS_MOUNT_FLAG_WRITE 0x00000010
  112. #define SYS_MOUNT_FLAG_TARGET_UNLINKED 0x00000020
  113. #define SYS_MOUNT_FLAG_DETACH 0x00000040
  114. //
  115. // Define file I/O flags.
  116. //
  117. #define SYS_IO_FLAG_WRITE 0x00000001
  118. #define SYS_IO_FLAG_MASK 0x00000001
  119. //
  120. // Define flush flags.
  121. //
  122. #define SYS_FLUSH_FLAG_ALL 0x00000001
  123. #define SYS_FLUSH_FLAG_READ 0x00000002
  124. #define SYS_FLUSH_FLAG_WRITE 0x00000004
  125. #define SYS_FLUSH_FLAG_DISCARD 0x00000008
  126. //
  127. // Define memory mapping flags.
  128. //
  129. #define SYS_MAP_FLAG_READ 0x00000001
  130. #define SYS_MAP_FLAG_WRITE 0x00000002
  131. #define SYS_MAP_FLAG_EXECUTE 0x00000004
  132. #define SYS_MAP_FLAG_SHARED 0x00000008
  133. #define SYS_MAP_FLAG_FIXED 0x00000010
  134. #define SYS_MAP_FLAG_ANONYMOUS 0x00000020
  135. //
  136. // Define memory mapping flush flags.
  137. //
  138. #define SYS_MAP_FLUSH_FLAG_ASYNC 0x00000001
  139. //
  140. // Define wait system call flags.
  141. //
  142. //
  143. // Set this flag to return immediately if no signals are pending.
  144. //
  145. #define SYSTEM_CALL_WAIT_FLAG_RETURN_IMMEDIATELY 0x00000001
  146. //
  147. // Set this flag to wait specifically for children that have stopped, and
  148. // discard the signal when found.
  149. //
  150. #define SYSTEM_CALL_WAIT_FLAG_STOPPED_CHILDREN 0x00000002
  151. //
  152. // Set this flag to wait specifially for continued children, and discard the
  153. // signal when found.
  154. //
  155. #define SYSTEM_CALL_WAIT_FLAG_CONTINUED_CHILDREN 0x00000004
  156. //
  157. // This bitmask waits for any child action (exited, stopped, or continued).
  158. //
  159. #define SYSTEM_CALL_WAIT_FLAG_CHILD_MASK \
  160. (SYSTEM_CALL_WAIT_FLAG_EXITED_CHILDREN | \
  161. SYSTEM_CALL_WAIT_FLAG_STOPPED_CHILDREN | \
  162. SYSTEM_CALL_WAIT_FLAG_CONTINUED_CHILDREN)
  163. //
  164. // Set this flag to wait specifically for children that have exited, and
  165. // discard the signal when found.
  166. //
  167. #define SYSTEM_CALL_WAIT_FLAG_EXITED_CHILDREN 0x00000008
  168. //
  169. // Set this flag to not discard a pending child signal.
  170. //
  171. #define SYSTEM_CALL_WAIT_FLAG_DONT_DISCARD_CHILD 0x00000010
  172. //
  173. // Define the polling events.
  174. //
  175. #define POLL_EVENT_IN 0x00000001
  176. #define POLL_EVENT_IN_HIGH_PRIORITY 0x00000002
  177. #define POLL_EVENT_OUT 0x00000004
  178. #define POLL_EVENT_OUT_HIGH_PRIORITY 0x00000008
  179. #define POLL_EVENT_ERROR 0x00000010
  180. #define POLL_EVENT_DISCONNECTED 0x00000020
  181. #define POLL_EVENT_INVALID_HANDLE 0x00000040
  182. //
  183. // Define the mask of error events.
  184. //
  185. #define POLL_ERROR_EVENTS \
  186. (POLL_EVENT_ERROR | POLL_EVENT_DISCONNECTED | POLL_EVENT_INVALID_HANDLE)
  187. //
  188. // Define the mask of events that is always returned.
  189. //
  190. #define POLL_NONMASKABLE_EVENTS \
  191. (POLL_EVENT_ERROR | POLL_EVENT_DISCONNECTED | POLL_EVENT_INVALID_HANDLE)
  192. //
  193. // Define the mask of events that are always returned for files.
  194. //
  195. #define POLL_NONMASKABLE_FILE_EVENTS \
  196. (POLL_EVENT_IN | POLL_EVENT_IN_HIGH_PRIORITY | POLL_EVENT_OUT | \
  197. POLL_EVENT_OUT_HIGH_PRIORITY)
  198. //
  199. // Define the effective access permission flags.
  200. //
  201. #define EFFECTIVE_ACCESS_EXECUTE 0x00000001
  202. #define EFFECTIVE_ACCESS_WRITE 0x00000002
  203. #define EFFECTIVE_ACCESS_READ 0x00000004
  204. //
  205. // Define the timer control flags.
  206. //
  207. #define TIMER_CONTROL_FLAG_USE_TIMER_NUMBER 0x00000001
  208. #define TIMER_CONTROL_FLAG_SIGNAL_THREAD 0x00000002
  209. //
  210. // ------------------------------------------------------ Data Type Definitions
  211. //
  212. //
  213. // Define the system call numbers. Note that the first few are defined in
  214. // assmebly as well, so if the top of this table changes arrangement those
  215. // first few would need upkeep as well. Please move any system call numbers
  216. // referenced from assembly to the top.
  217. //
  218. typedef enum _SYSTEM_CALL_NUMBER {
  219. SystemCallInvalid,
  220. SystemCallRestoreContext,
  221. SystemCallForkProcess,
  222. SystemCallExitThread,
  223. SystemCallOpen,
  224. SystemCallClose,
  225. SystemCallPerformIo,
  226. SystemCallCreatePipe,
  227. SystemCallCreateThread,
  228. SystemCallExecuteImage,
  229. SystemCallChangeDirectory,
  230. SystemCallSetSignalHandler,
  231. SystemCallSendSignal,
  232. SystemCallGetSetProcessId,
  233. SystemCallSetSignalBehavior,
  234. SystemCallWaitForChildProcess,
  235. SystemCallSuspendExecution,
  236. SystemCallExitProcess,
  237. SystemCallPoll,
  238. SystemCallSocketCreate,
  239. SystemCallSocketBind,
  240. SystemCallSocketListen,
  241. SystemCallSocketAccept,
  242. SystemCallSocketConnect,
  243. SystemCallSocketPerformIo,
  244. SystemCallFileControl,
  245. SystemCallGetSetFileInformation,
  246. SystemCallDebug,
  247. SystemCallSeek,
  248. SystemCallCreateSymbolicLink,
  249. SystemCallReadSymbolicLink,
  250. SystemCallDelete,
  251. SystemCallRename,
  252. SystemCallMountOrUnmount,
  253. SystemCallQueryTimeCounter,
  254. SystemCallTimerControl,
  255. SystemCallGetEffectiveAccess,
  256. SystemCallDelayExecution,
  257. SystemCallUserControl,
  258. SystemCallFlush,
  259. SystemCallGetResourceUsage,
  260. SystemCallLoadDriver,
  261. SystemCallFlushCache,
  262. SystemCallGetCurrentDirectory,
  263. SystemCallSocketGetSetInformation,
  264. SystemCallSocketShutdown,
  265. SystemCallCreateHardLink,
  266. SystemCallMapOrUnmapMemory,
  267. SystemCallFlushMemory,
  268. SystemCallLocateDeviceInformation,
  269. SystemCallGetSetDeviceInformation,
  270. SystemCallOpenDevice,
  271. SystemCallGetSetSystemInformation,
  272. SystemCallResetSystem,
  273. SystemCallSetSystemTime,
  274. SystemCallSetMemoryProtection,
  275. SystemCallSetThreadIdentity,
  276. SystemCallSetThreadPermissions,
  277. SystemCallSetSupplementaryGroups,
  278. SystemCallSocketCreatePair,
  279. SystemCallCreateTerminal,
  280. SystemCallSocketPerformVectoredIo,
  281. SystemCallSetThreadPointer,
  282. SystemCallUserLock,
  283. SystemCallSetThreadIdPointer,
  284. SystemCallSetUmask,
  285. SystemCallDuplicateHandle,
  286. SystemCallPerformVectoredIo,
  287. SystemCallSetITimer,
  288. SystemCallSetResourceLimit,
  289. SystemCallSetBreak,
  290. SystemCallCount
  291. } SYSTEM_CALL_NUMBER, *PSYSTEM_CALL_NUMBER;
  292. typedef enum _SIGNAL_MASK_OPERATION {
  293. SignalMaskOperationNone,
  294. SignalMaskOperationOverwrite,
  295. SignalMaskOperationSet,
  296. SignalMaskOperationClear,
  297. } SIGNAL_MASK_OPERATION, *PSIGNAL_MASK_OPERATION;
  298. typedef enum _SIGNAL_MASK_TYPE {
  299. SignalMaskTypeInvalid,
  300. SignalMaskBlocked,
  301. SignalMaskIgnored,
  302. SignalMaskHandled,
  303. SignalMaskPending,
  304. } SIGNAL_MASK_TYPE, *PSIGNAL_MASK_TYPE;
  305. typedef enum _SIGNAL_TARGET_TYPE {
  306. SignalTargetTypeInvalid,
  307. SignalTargetProcess,
  308. SignalTargetThread,
  309. SignalTargetAllProcesses,
  310. SignalTargetProcessGroup,
  311. SignalTargetCurrentProcess,
  312. SignalTargetCurrentProcessGroup,
  313. } SIGNAL_TARGET_TYPE, *PSIGNAL_TARGET_TYPE;
  314. typedef enum _FILE_LOCK_TYPE {
  315. FileLockInvalid,
  316. FileLockRead,
  317. FileLockReadWrite,
  318. FileLockUnlock,
  319. FileLockTypeCount
  320. } FILE_LOCK_TYPE, *PFILE_LOCK_TYPE;
  321. typedef enum _FILE_CONTROL_COMMAND {
  322. FileControlCommandInvalid,
  323. FileControlCommandDuplicate,
  324. FileControlCommandGetFlags,
  325. FileControlCommandSetFlags,
  326. FileControlCommandGetStatusAndAccess,
  327. FileControlCommandSetStatus,
  328. FileControlCommandGetSignalOwner,
  329. FileControlCommandSetSignalOwner,
  330. FileControlCommandGetLock,
  331. FileControlCommandSetLock,
  332. FileControlCommandBlockingSetLock,
  333. FileControlCommandGetFileInformation,
  334. FileControlCommandSetFileInformation,
  335. FileControlCommandSetDirectoryFlag,
  336. FileControlCommandCloseFrom,
  337. FileControlCommandGetPath,
  338. FileControlCommandCount
  339. } FILE_CONTROL_COMMAND, *PFILE_CONTROL_COMMAND;
  340. typedef enum _TIMER_OPERATION {
  341. TimerOperationInvalid,
  342. TimerOperationCreateTimer,
  343. TimerOperationDeleteTimer,
  344. TimerOperationGetTimer,
  345. TimerOperationSetTimer
  346. } TIMER_OPERATION, *PTIMER_OPERATION;
  347. typedef enum _ITIMER_TYPE {
  348. ITimerReal,
  349. ITimerVirtual,
  350. ITimerProfile,
  351. ITimerTypeCount
  352. } ITIMER_TYPE, *PITIMER_TYPE;
  353. typedef enum _RESOURCE_USAGE_REQUEST {
  354. ResourceUsageRequestInvalid,
  355. ResourceUsageRequestProcess,
  356. ResourceUsageRequestProcessChildren,
  357. ResourceUsageRequestThread,
  358. } RESOURCE_USAGE_REQUEST, *PRESOURCE_USAGE_REQUEST;
  359. //
  360. // System call parameter structures
  361. //
  362. /*++
  363. Structure Description:
  364. This structure defines the system call parameters for the fork call.
  365. Members:
  366. Flags - Stores a bitfield of flags governing the behavior of the child.
  367. FrameRestoreBase - Stores an optional pointer that is only used if the
  368. VFORK flag is set in the child. In this case, the kernel will copy a
  369. region of the stack from this supplied pointer to the current stack
  370. pointer into temporary storage. When the child execs or exits, the
  371. kernel will copy this region back into the process, "restoring" that
  372. region of the stack after the child trashed it.
  373. --*/
  374. typedef struct _SYSTEM_CALL_FORK {
  375. ULONG Flags;
  376. PVOID FrameRestoreBase;
  377. } SYSCALL_STRUCT SYSTEM_CALL_FORK, *PSYSTEM_CALL_FORK;
  378. /*++
  379. Structure Description:
  380. This structure defines the system call parameters for exiting the current
  381. thread.
  382. Members:
  383. UnmapAddress - Supplies an optional pointer to a region to unmap (usually
  384. the thread stack if it was allocated in user mode).
  385. UnmapSize - Supplies the size of the region to unmap. This must be aligned
  386. to a page boundary.
  387. --*/
  388. typedef struct _SYSTEM_CALL_EXIT_THREAD {
  389. PVOID UnmapAddress;
  390. UINTN UnmapSize;
  391. } SYSCALL_STRUCT SYSTEM_CALL_EXIT_THREAD, *PSYSTEM_CALL_EXIT_THREAD;
  392. /*++
  393. Structure Description:
  394. This structure defines the system call parameters for the open call.
  395. Members:
  396. Directory - Stores an optional handle to the directory to start path
  397. traversal from if the specified path is relative. Supply INVALID_HANDLE
  398. here to use the current directory for relative paths.
  399. Path - Stores a pointer to a string containing the path of the object to
  400. open.
  401. PathBufferLength - Stores the length of the path buffer, in bytes,
  402. including the null terminator.
  403. Flags - Stores a bitfield of flags. See SYS_OPEN_FLAG_* definitions.
  404. CreatePermissions - Stores the permissions to apply to a created file.
  405. Handle - Stores a handle where the file handle will be returned on success.
  406. --*/
  407. typedef struct _SYSTEM_CALL_OPEN {
  408. HANDLE Directory;
  409. PCSTR Path;
  410. ULONG PathBufferLength;
  411. ULONG Flags;
  412. FILE_PERMISSIONS CreatePermissions;
  413. HANDLE Handle;
  414. } SYSCALL_STRUCT SYSTEM_CALL_OPEN, *PSYSTEM_CALL_OPEN;
  415. /*++
  416. Structure Description:
  417. This structure defines the system call parameters for the call to do I/O.
  418. Members:
  419. Handle - Stores the handle to do file I/O to.
  420. Buffer - Stores the buffer (in user mode) to read from or write to.
  421. Flags - Stores flags related to the I/O operation. See SYS_IO_FLAG_*
  422. definitions.
  423. TimeoutInMilliseconds - Stores the number of milliseconds that the I/O
  424. operation should be waited on before timing out. Use
  425. SYS_WAIT_TIME_INDEFINITE to wait forever on the I/O.
  426. Offset - Stores the offset the I/O should occur at. Supply -1ULL to use the
  427. current file pointer offset.
  428. Size - Stores the number of bytes of I/O to complete on input.
  429. --*/
  430. typedef struct _SYSTEM_CALL_PERFORM_IO {
  431. HANDLE Handle;
  432. PVOID Buffer;
  433. ULONG Flags;
  434. ULONG TimeoutInMilliseconds;
  435. IO_OFFSET Offset;
  436. INTN Size;
  437. } SYSCALL_STRUCT SYSTEM_CALL_PERFORM_IO, *PSYSTEM_CALL_PERFORM_IO;
  438. /*++
  439. Structure Description:
  440. This structure defines the system call parameters for the call to do I/O.
  441. Members:
  442. Handle - Stores the handle to do file I/O to.
  443. Buffer - Stores the buffer (in user mode) to read from or write to.
  444. Flags - Stores flags related to the I/O operation. See SYS_IO_FLAG_*
  445. definitions.
  446. TimeoutInMilliseconds - Stores the number of milliseconds that the I/O
  447. operation should be waited on before timing out. Use
  448. SYS_WAIT_TIME_INDEFINITE to wait forever on the I/O.
  449. Offset - Stores the offset the I/O should occur at. Supply -1ULL to use the
  450. current file pointer offset.
  451. Size - Stores the number of bytes of I/O to complete on input.
  452. VectoryArray - Stores a pointer to an array of I/O vector structures which
  453. specify the buffers to read or write.
  454. VectorCount - Stores the number of elements in the vector array.
  455. --*/
  456. typedef struct _SYSTEM_CALL_PERFORM_VECTORED_IO {
  457. HANDLE Handle;
  458. PVOID Buffer;
  459. ULONG Flags;
  460. ULONG TimeoutInMilliseconds;
  461. IO_OFFSET Offset;
  462. INTN Size;
  463. PIO_VECTOR VectorArray;
  464. UINTN VectorCount;
  465. } SYSCALL_STRUCT SYSTEM_CALL_PERFORM_VECTORED_IO,
  466. *PSYSTEM_CALL_PERFORM_VECTORED_IO;
  467. /*++
  468. Structure Description:
  469. This structure defines the system call parameters for the create pipe call.
  470. Members:
  471. Directory - Stores an optional handle to the directory to start path
  472. traversal from if the specified path is relative. Supply INVALID_HANDLE
  473. here to use the current directory for relative paths.
  474. Path - Stores an optional pointer to a names path for the pipe.
  475. PathLength - Stores the length of the path buffer in bytes, including the
  476. null terminator.
  477. OpenFlags - Stores the set of open flags associated with the handle. Only
  478. SYS_OPEN_FLAG_CLOSE_ON_EXECUTE and SYS_OPEN_FLAG_NON_BLOCKING are
  479. accepted.
  480. Permissions - Stores the permissions to apply to the new pipe.
  481. ReadHandle - Stores the returned handle to the read side of the pipe.
  482. WriteHandle - Stores the returned handle to the write side of the pipe.
  483. --*/
  484. typedef struct _SYSTEM_CALL_CREATE_PIPE {
  485. HANDLE Directory;
  486. PSTR Path;
  487. ULONG PathLength;
  488. ULONG OpenFlags;
  489. FILE_PERMISSIONS Permissions;
  490. HANDLE ReadHandle;
  491. HANDLE WriteHandle;
  492. } SYSCALL_STRUCT SYSTEM_CALL_CREATE_PIPE, *PSYSTEM_CALL_CREATE_PIPE;
  493. /*++
  494. Structure Description:
  495. This structure defines the system call parameters for the create thread
  496. call.
  497. Members:
  498. Name - Stores a pointer to an optional string containing the name of the
  499. new thread.
  500. NameBufferLength - Stores the length of the name buffer. Supply 0 if no
  501. name was given.
  502. ThreadRoutine - Stores a pointer to the function that should be executed
  503. on the new thread.
  504. Parameter - Stores a pointer parameter that will be passed directly to the
  505. thread routine.
  506. StackBase - Stores an optional pointer on input where the thread stack
  507. should be located. Supply NULL to have the stack placed anywhere. On
  508. output, contains the base address of the stack.
  509. StackSize - Stores the requested size of the stack for this thread. Supply
  510. 0 to use the system default value. On output, contains the actual size
  511. of the stack.
  512. ThreadPointer - Stores the thread pointer to set for the new thread.
  513. ThreadId - Stores an optional pointer where the thread ID is returned. This
  514. address is also set as the thread's thread ID address. If the thread
  515. terminates, zero is written to this value and a UserLockWake operation
  516. is called on that address to wake up one thread.
  517. --*/
  518. typedef struct _SYSTEM_CALL_CREATE_THREAD {
  519. PSTR Name;
  520. ULONG NameBufferLength;
  521. PTHREAD_ENTRY_ROUTINE ThreadRoutine;
  522. PVOID Parameter;
  523. PVOID StackBase;
  524. ULONG StackSize;
  525. PVOID ThreadPointer;
  526. PTHREAD_ID ThreadId;
  527. } SYSCALL_STRUCT SYSTEM_CALL_CREATE_THREAD, *PSYSTEM_CALL_CREATE_THREAD;
  528. /*++
  529. Structure Description:
  530. This structure defines the system call parameters for the execute image
  531. system call.
  532. Members:
  533. Environment - Stores the image name, arguments, and environment.
  534. --*/
  535. typedef struct _SYSTEM_CALL_EXECUTE_IMAGE {
  536. PROCESS_ENVIRONMENT Environment;
  537. } SYSCALL_STRUCT SYSTEM_CALL_EXECUTE_IMAGE, *PSYSTEM_CALL_EXECUTE_IMAGE;
  538. /*++
  539. Structure Description:
  540. This structure defines the system call parameters for changing the current
  541. directory or the root directory.
  542. Members:
  543. Root - Stores a boolean indicating whether to change the current working
  544. directory (FALSE) or the current root directory (TRUE).
  545. Buffer - Stores a pointer to the buffer containing the directory to change
  546. to. Either this parameter or the handle must be valid.
  547. BufferLength - Stores the length of the aforementioned buffer, in bytes,
  548. including the null terminator.
  549. Handle - Stores the open handle to the directory to change to. If this is
  550. not INVALID_HANDLE, then this will be used. Otherwise, the path
  551. pointed to by the buffer will be used.
  552. --*/
  553. typedef struct _SYSTEM_CALL_CHANGE_DIRECTORY {
  554. BOOL Root;
  555. PSTR Buffer;
  556. ULONG BufferLength;
  557. HANDLE Handle;
  558. } SYSCALL_STRUCT SYSTEM_CALL_CHANGE_DIRECTORY, *PSYSTEM_CALL_CHANGE_DIRECTORY;
  559. /*++
  560. Structure Description:
  561. This structure defines the system call parameters for setting a new signal
  562. handler routine.
  563. Members:
  564. SignalHandler - Stores a pointer to the user mode routine that will be
  565. called to handle signals. The parameters to the function are the
  566. signal number and optional parameter, both of which will be passed in
  567. registers. On output, this pointer will contain the original signal
  568. handler pointer, or NULL if no signal handler was previouly registered.
  569. --*/
  570. typedef struct _SYSTEM_CALL_SET_SIGNAL_HANDLER {
  571. PVOID SignalHandler;
  572. } SYSCALL_STRUCT SYSTEM_CALL_SET_SIGNAL_HANDLER,
  573. *PSYSTEM_CALL_SET_SIGNAL_HANDLER;
  574. /*++
  575. Structure Description:
  576. This structure defines the system call parameters for sending a signal to
  577. a process, process group, or thread.
  578. Members:
  579. TargetType - Supplies the target to which the signal is being sent. It can
  580. be either a process, process group, or thread.
  581. TargetId - Supplies the ID for the signal's target process, process group,
  582. or thread.
  583. SignalNumber - Stores the signal number to send.
  584. SignalCode - Stores the code to send. For user generated signals this must
  585. be less than or equal to 0, otherwise it will be set to 0. See
  586. SIGNAL_CODE_* definitions.
  587. SignalParameter - Stores the parameter to send with the signal for real time
  588. signals.
  589. Status - Stores the result returned by the kernel from the operation.
  590. --*/
  591. typedef struct _SYSTEM_CALL_SEND_SIGNAL {
  592. SIGNAL_TARGET_TYPE TargetType;
  593. ULONG TargetId;
  594. ULONG SignalNumber;
  595. SHORT SignalCode;
  596. UINTN SignalParameter;
  597. } SYSCALL_STRUCT SYSTEM_CALL_SEND_SIGNAL, *PSYSTEM_CALL_SEND_SIGNAL;
  598. /*++
  599. Structure Description:
  600. This structure defines the system call parameters for getting and setting
  601. various process IDs, including the process ID, thread ID, process group
  602. ID, session ID, and parent process ID.
  603. Members:
  604. ProcessIdType - Stores the type of identifier to get or set. Not all types
  605. can be set.
  606. ProcessId - Stores the process ID parameter on input if applicable, and
  607. returns the result on success.
  608. NewValue - Stores the new value to set for types that can be set (like
  609. process group ID).
  610. Set - Stores a boolean indicating whether to get the process ID of the
  611. given type or set it.
  612. --*/
  613. typedef struct _SYSTEM_CALL_GET_SET_PROCESS_ID {
  614. PROCESS_ID_TYPE ProcessIdType;
  615. PROCESS_ID ProcessId;
  616. PROCESS_ID NewValue;
  617. BOOL Set;
  618. } SYSCALL_STRUCT SYSTEM_CALL_GET_SET_PROCESS_ID,
  619. *PSYSTEM_CALL_GET_SET_PROCESS_ID;
  620. /*++
  621. Structure Description:
  622. This structure defines the system call parameters for setting the current
  623. thread signal behavior.
  624. Members:
  625. Operation - Stores the operation to perform: set, clear, or overwrite.
  626. MaskType - Stores the signal mask to operate on.
  627. SignalSet - Stores the new signal set on input. On output, contains the
  628. original signal set of the specified type.
  629. --*/
  630. typedef struct _SYSTEM_CALL_SET_SIGNAL_BEHAVIOR {
  631. SIGNAL_MASK_OPERATION Operation;
  632. SIGNAL_MASK_TYPE MaskType;
  633. SIGNAL_SET SignalSet;
  634. } SYSCALL_STRUCT SYSTEM_CALL_SET_SIGNAL_BEHAVIOR,
  635. *PSYSTEM_CALL_SET_SIGNAL_BEHAVIOR;
  636. /*++
  637. Structure Description:
  638. This structure defines the system call parameters for suspending execution
  639. until a signal comes in. This may be any old signal, or it may wait for
  640. and dequeue a child signal.
  641. Members:
  642. Flags - Stores a bitfield of flags governing behavior of the wait. See
  643. SYSTEM_CALL_WAIT_FLAG_* definititions.
  644. ChildPid - Stores the PID parameter to wait for on input. The value can be
  645. positive to wait on a specific pid, 0 to wait any child process whose
  646. process group is equal to that of the calling process, -1 to wait on
  647. any process, or another negative number to wait on a process whose
  648. process group ID is equal to the absolute value of the PID parameter.
  649. On output, contains the child PID causing the signal, returned by the
  650. kernel. If the parameter indicating that the wait is for a child is
  651. FALSE, this parameter should be ignored by user mode.
  652. ChildExitValue - Stores the exit status code returned by the child process
  653. if the reason was that the child exited. Otherwise, this contains the
  654. signal number that caused the child to terminate, dump, or stop.
  655. Reason - Stores the reason for the child event. See CHILD_SIGNAL_REASON_*
  656. definitions.
  657. ResourceUsage - Stores an optional pointer where the kernel will fill in
  658. resource usage of the child on success.
  659. --*/
  660. typedef struct _SYSTEM_CALL_WAIT_FOR_CHILD {
  661. ULONG Flags;
  662. PROCESS_ID ChildPid;
  663. UINTN ChildExitValue;
  664. ULONG Reason;
  665. PRESOURCE_USAGE ResourceUsage;
  666. } SYSCALL_STRUCT SYSTEM_CALL_WAIT_FOR_CHILD, *PSYSTEM_CALL_WAIT_FOR_CHILD;
  667. /*++
  668. Structure Description:
  669. This structure defines the system call parameters for suspending execution
  670. until a signal comes in.
  671. Members:
  672. SignalOperation - Stores the operation to perform with the signal set: set,
  673. clear, overwrite, or none.
  674. SignalSet - Stores the signal set to apply for the duration of this call as
  675. dictated by the signal operation.
  676. TimeoutInMilliseconds - Stores the timeout in milliseconds the caller
  677. should wait. Set to SYS_WAIT_TIME_INDEFINITE to wait forever.
  678. SignalParameters - Stores an optional pointer where the signal information
  679. for the signal that occurred will be returned.
  680. --*/
  681. typedef struct _SYSTEM_CALL_SUSPEND_EXECUTION {
  682. SIGNAL_MASK_OPERATION SignalOperation;
  683. SIGNAL_SET SignalSet;
  684. ULONG TimeoutInMilliseconds;
  685. PSIGNAL_PARAMETERS SignalParameters;
  686. } SYSCALL_STRUCT SYSTEM_CALL_SUSPEND_EXECUTION, *PSYSTEM_CALL_SUSPEND_EXECUTION;
  687. /*++
  688. Structure Description:
  689. This structure defines an element in the array of file descriptors to be
  690. polled.
  691. Members:
  692. Handle - Stores the I/O handle to wait for.
  693. Events - Stores the bitmask of events to wait for.
  694. ReturnedEvents - Stores the bitmask of events that occurred for this file
  695. descriptor.
  696. --*/
  697. typedef struct _POLL_DESCRIPTOR {
  698. HANDLE Handle;
  699. USHORT Events;
  700. USHORT ReturnedEvents;
  701. } POLL_DESCRIPTOR, *PPOLL_DESCRIPTOR;
  702. /*++
  703. Structure Description:
  704. This structure defines the system call parameters for polling several I/O
  705. handles.
  706. Members:
  707. SignalMask - Stores an optional pointer to a signal mask to set for the
  708. duration of the poll.
  709. Descriptors - Stores a pointer to a buffer containing an array of poll
  710. descriptors.
  711. DescriptorCount - Stores the number of elements in the descriptors array.
  712. TimeoutInMilliseconds - Stores the number of milliseconds to wait for one
  713. of the descriptors to become ready before giving up.
  714. --*/
  715. typedef struct _SYSTEM_CALL_POLL {
  716. PSIGNAL_SET SignalMask;
  717. PPOLL_DESCRIPTOR Descriptors;
  718. LONG DescriptorCount;
  719. ULONG TimeoutInMilliseconds;
  720. } SYSCALL_STRUCT SYSTEM_CALL_POLL, *PSYSTEM_CALL_POLL;
  721. /*++
  722. Structure Description:
  723. This structure defines the system call parameters for creating a new
  724. socket.
  725. Members:
  726. Domain - Stores the network domain to use on the socket.
  727. Type - Stores the socket connection type.
  728. Protocol - Stores the raw network protocol to use on the socket.
  729. These are network specific. For example, for IPv4 and IPv6, the values
  730. are taken from the Internet Assigned Numbers Authority (IANA).
  731. OpenFlags - Stores an optional bitfield of open flags for the new socket.
  732. Only SYS_OPEN_FLAG_NON_BLOCKING and SYS_OPEN_FLAG_CLOSE_ON_EXECUTE
  733. are accepted.
  734. Socket - Stores the returned socket file descriptor on success.
  735. --*/
  736. typedef struct _SYSTEM_CALL_SOCKET_CREATE {
  737. NET_DOMAIN_TYPE Domain;
  738. NET_SOCKET_TYPE Type;
  739. ULONG Protocol;
  740. ULONG OpenFlags;
  741. HANDLE Socket;
  742. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_CREATE, *PSYSTEM_CALL_SOCKET_CREATE;
  743. /*++
  744. Structure Description:
  745. This structure defines the system call parameters for binding a socket to
  746. an address.
  747. Members:
  748. Socket - Stores the socket to bind to.
  749. Address - Stores the local address to bind the socket to.
  750. Path - Stores a pointer to the path, in the case that this is a Unix socket.
  751. PathSize - Stores the size of the path, in bytes, including the null
  752. terminator.
  753. --*/
  754. typedef struct _SYSTEM_CALL_SOCKET_BIND {
  755. HANDLE Socket;
  756. NETWORK_ADDRESS Address;
  757. PSTR Path;
  758. UINTN PathSize;
  759. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_BIND, *PSYSTEM_CALL_SOCKET_BIND;
  760. /*++
  761. Structure Description:
  762. This structure defines the system call parameters for making a socket
  763. eligible to accept incoming connections.
  764. Members:
  765. Socket - Stores the socket to activate.
  766. BacklogCount - Stores a suggested number of pending (un-accepted) incoming
  767. connections the kernel should queue before rejecting additional
  768. incoming connections.
  769. --*/
  770. typedef struct _SYSTEM_CALL_SOCKET_LISTEN {
  771. HANDLE Socket;
  772. ULONG BacklogCount;
  773. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_LISTEN, *PSYSTEM_CALL_SOCKET_LISTEN;
  774. /*++
  775. Structure Description:
  776. This structure defines the system call parameters for accepting a new
  777. incoming connection on a listening socket.
  778. Members:
  779. Socket - Stores the socket to accept a new connection from.
  780. NewSocket - Stores the new socket file descriptor on success, which
  781. represents the new connection.
  782. Address - Stores the network address of the party that just created this
  783. new incoming connection.
  784. RemotePath - Stores a pointer where the remote path of the client socket
  785. will be copied on success. This only applies to local sockets.
  786. RemotePathSize - Stores on input the size of the remote path buffer. On
  787. output, contains the true size of the remote path, even if it was
  788. bigger than the input.
  789. OpenFlags - Stores an optional bitfield of open flags for the new socket.
  790. Only SYS_OPEN_FLAG_NON_BLOCKING and SYS_OPEN_FLAG_CLOSE_ON_EXECUTE
  791. are accepted.
  792. --*/
  793. typedef struct _SYSTEM_CALL_SOCKET_ACCEPT {
  794. HANDLE Socket;
  795. HANDLE NewSocket;
  796. NETWORK_ADDRESS Address;
  797. PSTR RemotePath;
  798. UINTN RemotePathSize;
  799. ULONG OpenFlags;
  800. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_ACCEPT, *PSYSTEM_CALL_SOCKET_ACCEPT;
  801. /*++
  802. Structure Description:
  803. This structure defines the system call parameters for connecting to another
  804. socket.
  805. Members:
  806. Socket - Stores the socket to use to initiate the connection.
  807. Address - Stores the network address to connect to.
  808. RemotePath - Stores a pointer to the remote path if this is a local socket.
  809. RemotePathSize - Stores the size of the remote path buffer in bytes,
  810. including the null terminator.
  811. --*/
  812. typedef struct _SYSTEM_CALL_SOCKET_CONNECT {
  813. HANDLE Socket;
  814. NETWORK_ADDRESS Address;
  815. PSTR RemotePath;
  816. UINTN RemotePathSize;
  817. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_CONNECT, *PSYSTEM_CALL_SOCKET_CONNECT;
  818. /*++
  819. Structure Description:
  820. This structure defines the system call parameters for sending or receiving
  821. socket data to or from a specified host. Sockets may also use the generic
  822. perform I/O system call if the caller does not with to specify or learn the
  823. remote host address.
  824. Members:
  825. Socket - Stores the socket to use.
  826. Parameters - Stores a required pointer to the socket I/O parameters.
  827. Buffer - Stores the buffer to read from or write to.
  828. --*/
  829. typedef struct _SYSTEM_CALL_SOCKET_PERFORM_IO {
  830. HANDLE Socket;
  831. PSOCKET_IO_PARAMETERS Parameters;
  832. PVOID Buffer;
  833. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_PERFORM_IO, *PSYSTEM_CALL_SOCKET_PERFORM_IO;
  834. /*++
  835. Structure Description:
  836. This structure defines the system call parameters for performing socket
  837. I/O using an I/O vector.
  838. Members:
  839. Socket - Stores the socket to use.
  840. Parameters - Stores a required pointer to the socket I/O parameters.
  841. VectorArray - Stores a pointer to an array of I/O vectors.
  842. VectorCount - Stores the number of elements in the vector array.
  843. --*/
  844. typedef struct _SYSTEM_CALL_SOCKET_PERFORM_VECTORED_IO {
  845. HANDLE Socket;
  846. PSOCKET_IO_PARAMETERS Parameters;
  847. PIO_VECTOR VectorArray;
  848. UINTN VectorCount;
  849. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_PERFORM_VECTORED_IO,
  850. *PSYSTEM_CALL_SOCKET_PERFORM_VECTORED_IO;
  851. /*++
  852. Structure Description:
  853. This structure defines the parameters of a file lock.
  854. Members:
  855. Type - Stores the file lock type.
  856. Offset - Stores the starting offset of the file lock.
  857. Size - Stores the size of the file lock. If zero, then the lock runs to the
  858. end of the file.
  859. ProcessId - Stores the process ID of the process that owns the lock. This
  860. is returned when getting the lock, and is ignored when setting the
  861. lock.
  862. --*/
  863. typedef struct _FILE_LOCK {
  864. FILE_LOCK_TYPE Type;
  865. ULONGLONG Offset;
  866. ULONGLONG Size;
  867. PROCESS_ID ProcessId;
  868. } FILE_LOCK, *PFILE_LOCK;
  869. /*++
  870. Structure Description:
  871. This structure defines a file path.
  872. Members:
  873. Path - Stores a pointer to the path.
  874. PathSize - Stores the size of the path.
  875. --*/
  876. typedef struct _FILE_PATH {
  877. PSTR Path;
  878. UINTN PathSize;
  879. } FILE_PATH, *PFILE_PATH;
  880. /*++
  881. Structure Description:
  882. This structure defines union of various parameters used by the file control
  883. call.
  884. Members:
  885. DuplicateDescriptor - Stores the requested minimum file descriptor of the
  886. duplicate on input for duplicate operations. On output, returns the
  887. new open file descriptor.
  888. SetFileInformation - Stores the request to get or set file information.
  889. FileLock - Stores the file lock information.
  890. Flags - Stores the file descriptor flags.
  891. FilePath - Stores the path of the file.
  892. Owner - Stores the ID of the process to receive signals on asynchronous
  893. I/O events.
  894. --*/
  895. typedef union _FILE_CONTROL_PARAMETERS_UNION {
  896. HANDLE DuplicateDescriptor;
  897. SET_FILE_INFORMATION SetFileInformation;
  898. FILE_LOCK FileLock;
  899. ULONG Flags;
  900. FILE_PATH FilePath;
  901. PROCESS_ID Owner;
  902. } FILE_CONTROL_PARAMETERS_UNION, *PFILE_CONTROL_PARAMETERS_UNION;
  903. /*++
  904. Structure Description:
  905. This structure defines the system call parameters for file control
  906. operations.
  907. Members:
  908. File - Stores the file handle to operate on.
  909. Command - Stores the file control command.
  910. Parameters - Stores a pointer to any additional command dependent
  911. parameters.
  912. --*/
  913. typedef struct _SYSTEM_CALL_FILE_CONTROL {
  914. HANDLE File;
  915. FILE_CONTROL_COMMAND Command;
  916. PFILE_CONTROL_PARAMETERS_UNION Parameters;
  917. } SYSCALL_STRUCT SYSTEM_CALL_FILE_CONTROL, *PSYSTEM_CALL_FILE_CONTROL;
  918. /*++
  919. Structure Description:
  920. This structure defines the system call parameters for the get/set file
  921. information system call.
  922. Members:
  923. Directory - Stores an optional handle to the directory to start path
  924. traversal from if the specified path is relative. Supply INVALID_HANDLE
  925. here to use the current directory for relative paths.
  926. FilePath - Stores a pointer to the file path string to get file information
  927. for.
  928. FilePathSize - Stores the size of the file path buffer in bytes including
  929. the null terminator.
  930. FollowLink - Stores a boolean indicating what to do if the file path points
  931. to a symbolic link. If set to TRUE, the file information set or
  932. returned will be for the file the link points to. If FALSE, the call
  933. will set or get information for the link itself.
  934. Request - Stores the file information request. For "get file information"
  935. requests, the file properties will be returned here. For "set file
  936. information" requests, this contains the fields to set.
  937. --*/
  938. typedef struct _SYSTEM_CALL_GET_SET_FILE_INFORMATION {
  939. HANDLE Directory;
  940. PSTR FilePath;
  941. ULONG FilePathSize;
  942. BOOL FollowLink;
  943. SET_FILE_INFORMATION Request;
  944. } SYSCALL_STRUCT SYSTEM_CALL_GET_SET_FILE_INFORMATION,
  945. *PSYSTEM_CALL_GET_SET_FILE_INFORMATION;
  946. /*++
  947. Structure Description:
  948. This structure defines the system call parameters for debug interface.
  949. Members:
  950. Process - Stores the ID of the process the command is operating on.
  951. Command - Supplies the command information.
  952. --*/
  953. typedef struct _SYSTEM_CALL_DEBUG {
  954. PROCESS_ID Process;
  955. PROCESS_DEBUG_COMMAND Command;
  956. } SYSCALL_STRUCT SYSTEM_CALL_DEBUG, *PSYSTEM_CALL_DEBUG;
  957. /*++
  958. Structure Description:
  959. This structure defines the system call parameters for a file seek operation.
  960. Members:
  961. Handle - Stores the handle to seek on.
  962. Command - Stores the seek command.
  963. Offset - Stores the offset to apply from the seek command. On return from
  964. the system call this contains the offset (after any seek has been
  965. applied).
  966. --*/
  967. typedef struct _SYSTEM_CALL_SEEK {
  968. HANDLE Handle;
  969. SEEK_COMMAND Command;
  970. IO_OFFSET Offset;
  971. } SYSCALL_STRUCT SYSTEM_CALL_SEEK, *PSYSTEM_CALL_SEEK;
  972. /*++
  973. Structure Description:
  974. This structure defines the system call parameters for creating a symbolic
  975. link.
  976. Members:
  977. Directory - Stores an optional handle to the directory to start path
  978. traversal from if the specified path is relative. Supply INVALID_HANDLE
  979. here to use the current directory for relative paths.
  980. Path - Stores a pointer to the symbolic link path.
  981. PathSize - Stores the size of the symbolic link pointer in bytes including
  982. the null terminator.
  983. LinkDestinationBuffer - Stores a pointer containing the target path of the
  984. link.
  985. LinkDestinationBufferSize - Stores the size of the link destination
  986. buffer in bytes including the null terminator.
  987. --*/
  988. typedef struct _SYSTEM_CALL_CREATE_SYMBOLIC_LINK {
  989. HANDLE Directory;
  990. PSTR Path;
  991. ULONG PathSize;
  992. PSTR LinkDestinationBuffer;
  993. ULONG LinkDestinationBufferSize;
  994. } SYSCALL_STRUCT SYSTEM_CALL_CREATE_SYMBOLIC_LINK,
  995. *PSYSTEM_CALL_CREATE_SYMBOLIC_LINK;
  996. /*++
  997. Structure Description:
  998. This structure defines the system call parameters for getting the value of
  999. a symbolic link.
  1000. Members:
  1001. Directory - Stores an optional handle to the directory to start path
  1002. traversal from if the specified path is relative. Supply INVALID_HANDLE
  1003. here to use the current directory for relative paths.
  1004. Path - Stores a pointer to the symbolic link path.
  1005. PathSize - Stores the size of the symbolic link pointer in bytes including
  1006. the null terminator.
  1007. LinkDestinationBuffer - Stores a pointer to a buffer where the destination
  1008. of the link will be returned. A null terminator is not written.
  1009. LinkDestinationBufferSize - Stores the size of the link destination
  1010. buffer in bytes.
  1011. LinkDestinationSize - Stores a pointer where the actual size of the link
  1012. destination will be returned on either success or a
  1013. STATUS_BUFFER_TOO_SMALL case. On failure, 0 will be returned here. This
  1014. size does not include a null terminator.
  1015. --*/
  1016. typedef struct _SYSTEM_CALL_READ_SYMBOLIC_LINK {
  1017. HANDLE Directory;
  1018. PSTR Path;
  1019. ULONG PathSize;
  1020. PSTR LinkDestinationBuffer;
  1021. ULONG LinkDestinationBufferSize;
  1022. ULONG LinkDestinationSize;
  1023. } SYSCALL_STRUCT SYSTEM_CALL_READ_SYMBOLIC_LINK,
  1024. *PSYSTEM_CALL_READ_SYMBOLIC_LINK;
  1025. /*++
  1026. Structure Description:
  1027. This structure defines the system call parameters for deleting an entry
  1028. from a directory.
  1029. Members:
  1030. Directory - Stores an optional handle to the directory to start path
  1031. traversal from if the specified path is relative. Supply INVALID_HANDLE
  1032. here to use the current directory for relative paths.
  1033. Path - Stores a pointer to the entry to delete.
  1034. PathSize - Stores the size of the path in bytes including the null
  1035. terminator.
  1036. Flags - Stores a bitfield of flags. See SYS_DELETE_FLAG_* definitions.
  1037. --*/
  1038. typedef struct _SYSTEM_CALL_DELETE {
  1039. HANDLE Directory;
  1040. PSTR Path;
  1041. ULONG PathSize;
  1042. ULONG Flags;
  1043. } SYSCALL_STRUCT SYSTEM_CALL_DELETE, *PSYSTEM_CALL_DELETE;
  1044. /*++
  1045. Structure Description:
  1046. This structure defines the system call parameters for renaming a file or
  1047. directory.
  1048. Members:
  1049. SourceDirectory - Stores an optional handle to the directory to start
  1050. relative source path searches from. If set to INVALID_HANDLE, relative
  1051. source paths will start from the current working directory.
  1052. SourcePath - Stores a pointer to the string containing the file or directory
  1053. to rename.
  1054. SourcePathSize - Stores the size of the source path string in bytes
  1055. including the null terminator.
  1056. DestinationDirectory - Stores an optional handle to the directory to start
  1057. relative destination path searches from. If set to INVALID_HANDLE,
  1058. relative destination paths will start from the current working
  1059. directory.
  1060. DestinationPath - Stores a pointer to the string containing the path to
  1061. rename the file or directory to.
  1062. DestinationPathSize - Stores the size of the destination path string in
  1063. bytes including the null terminator.
  1064. --*/
  1065. typedef struct _SYSTEM_CALL_RENAME {
  1066. HANDLE SourceDirectory;
  1067. PSTR SourcePath;
  1068. ULONG SourcePathSize;
  1069. HANDLE DestinationDirectory;
  1070. PSTR DestinationPath;
  1071. ULONG DestinationPathSize;
  1072. } SYSCALL_STRUCT SYSTEM_CALL_RENAME, *PSYSTEM_CALL_RENAME;
  1073. /*++
  1074. Structure Description:
  1075. This structure defines the system call parameters for mounting or
  1076. unmounting a file, directory, volume, pipe, socket or device.
  1077. Members:
  1078. MountPointPath - Stores a pointer to the string containing the path to the
  1079. mount point where the target is to be mounted, or from which it
  1080. should be unmounted.
  1081. MountPointPathSize - Stores the size of the mount point path string in
  1082. bytes, including the null terminator.
  1083. TargetPath - Stores a pointer to the string containing the path to the
  1084. target file, directory, volume, pipe, socket, or device that is to be
  1085. mounted.
  1086. TargetPathSize - Stores the size of the target path string in bytes,
  1087. including the null terminator.
  1088. Flags - Stores a bitfield of flags. See SYS_MOUNT_FLAG_* definitions.
  1089. --*/
  1090. typedef struct _SYSTEM_CALL_MOUNT_UNMOUNT {
  1091. PSTR MountPointPath;
  1092. ULONG MountPointPathSize;
  1093. PSTR TargetPath;
  1094. ULONG TargetPathSize;
  1095. ULONG Flags;
  1096. } SYSCALL_STRUCT SYSTEM_CALL_MOUNT_UNMOUNT, *PSYSTEM_CALL_MOUNT_UNMOUNT;
  1097. /*++
  1098. Structure Description:
  1099. This structure defines the system call parameters for retrieving the
  1100. current time counter value.
  1101. Members:
  1102. Value - Stores the time counter value returned by the kernel.
  1103. --*/
  1104. typedef struct _SYSTEM_CALL_QUERY_TIME_COUNTER {
  1105. ULONGLONG Value;
  1106. } SYSCALL_STRUCT SYSTEM_CALL_QUERY_TIME_COUNTER,
  1107. *PSYSTEM_CALL_QUERY_TIME_COUNTER;
  1108. /*++
  1109. Structure Description:
  1110. This structure stores information about a timer.
  1111. Members:
  1112. DueTime - Stores the next absolute due time of the timer, in time
  1113. counter ticks.
  1114. Period - Stores the period of the timer, in time counter ticks. A value of
  1115. 0 indicates a one-shot timer.
  1116. OverflowCount - Stores the number of additional timer overflows that have
  1117. occurred since the timer originally expired.
  1118. --*/
  1119. typedef struct _TIMER_INFORMATION {
  1120. ULONGLONG DueTime;
  1121. ULONGLONG Period;
  1122. ULONG OverflowCount;
  1123. } TIMER_INFORMATION, *PTIMER_INFORMATION;
  1124. /*++
  1125. Structure Description:
  1126. This structure defines the system call parameters for the timer control
  1127. operations.
  1128. Members:
  1129. Operation - Stores the operation to perform.
  1130. Flags - Stores a bitmask of time control flags. See TIMER_CONTROL_FLAG_*
  1131. for definitions.
  1132. TimerNumber - Stores either the timer number to operate on, or returns
  1133. the new timer number for create operations.
  1134. SignalNumber - Stores the number of the signal to raise when this timer
  1135. expires. This is only used for create timer requests.
  1136. SignalValue - Stores the signal value to send along with the raised signal
  1137. when the timer expires. This is only used for create timer requests.
  1138. ThreadId - Stores an optional ID of the thread to signal when the timer
  1139. expires. This is only used for create timer requests.
  1140. TimerInformation - Stores the timer information, either presented to the
  1141. kernel or returned by the kernel.
  1142. --*/
  1143. typedef struct _SYSTEM_CALL_TIMER_CONTROL {
  1144. TIMER_OPERATION Operation;
  1145. ULONG Flags;
  1146. LONG TimerNumber;
  1147. ULONG SignalNumber;
  1148. UINTN SignalValue;
  1149. THREAD_ID ThreadId;
  1150. TIMER_INFORMATION TimerInformation;
  1151. } SYSCALL_STRUCT SYSTEM_CALL_TIMER_CONTROL, *PSYSTEM_CALL_TIMER_CONTROL;
  1152. /*++
  1153. Structure Description:
  1154. This structure defines the system call parameters for getting the
  1155. effective access permissions on a file.
  1156. Members:
  1157. Directory - Stores an optional handle to the directory to start path
  1158. traversal from if the specified path is relative. Supply INVALID_HANDLE
  1159. here to use the current directory for relative paths.
  1160. FilePath - Stores a pointer to the string containing the file path.
  1161. FilePathSize - Stores the size of the file path buffer in bytes including
  1162. the null terminator.
  1163. UseRealIds - Stores a boolean indicating that the real user and group IDs
  1164. should be used for the access check instead of the effective user and
  1165. group IDs.
  1166. DesiredFlags - Stores the bitfield of flags the caller would like the
  1167. kernel to check on.
  1168. EffectiveAccess - Stores the set of flags returned by the kernel describing
  1169. the access the user has to the file. Only the desired flags will be
  1170. checked, all others will be zero.
  1171. --*/
  1172. typedef struct _SYSTEM_CALL_GET_EFFECTIVE_ACCESS {
  1173. HANDLE Directory;
  1174. PSTR FilePath;
  1175. ULONG FilePathSize;
  1176. BOOL UseRealIds;
  1177. ULONG DesiredFlags;
  1178. ULONG EffectiveAccess;
  1179. } SYSCALL_STRUCT SYSTEM_CALL_GET_EFFECTIVE_ACCESS,
  1180. *PSYSTEM_CALL_GET_EFFECTIVE_ACCESS;
  1181. /*++
  1182. Structure Description:
  1183. This structure defines the system call parameters for delaying execution
  1184. for a specified amount of time.
  1185. Members:
  1186. TimeTicks - Stores a boolean indicating if the interval parameter is
  1187. represented in time counter ticks (TRUE) or microseconds (FALSE).
  1188. Interval - Stores the interval to wait. If the time ticks parameter is
  1189. TRUE, this parameter represents an absolute time in time counter ticks.
  1190. If the time ticks parameter is FALSE, this parameter represents a
  1191. relative time from now in microseconds.
  1192. --*/
  1193. typedef struct _SYSTEM_CALL_DELAY_EXECUTION {
  1194. BOOL TimeTicks;
  1195. ULONGLONG Interval;
  1196. } SYSCALL_STRUCT SYSTEM_CALL_DELAY_EXECUTION, *PSYSTEM_CALL_DELAY_EXECUTION;
  1197. /*++
  1198. Structure Description:
  1199. This structure defines the system call parameters for a user I/O control
  1200. operation.
  1201. Members:
  1202. Handle - Stores the open file handle to perform the request on.
  1203. RequestCode - Stores the request code to send to the object. For devices,
  1204. this is the IRP minor code.
  1205. Context - Stores an optional context pointer.
  1206. ContextSize - Stores the size of the supplied context buffer in bytes. Set
  1207. this to zero if the context is not supplied or not a pointer.
  1208. --*/
  1209. typedef struct _SYSTEM_CALL_USER_CONTROL {
  1210. HANDLE Handle;
  1211. ULONG RequestCode;
  1212. PVOID Context;
  1213. UINTN ContextSize;
  1214. } SYSCALL_STRUCT SYSTEM_CALL_USER_CONTROL, *PSYSTEM_CALL_USER_CONTROL;
  1215. /*++
  1216. Structure Description:
  1217. This structure defines the system call parameters for a flush operation.
  1218. Members:
  1219. Handle - Stores the open file handle to perform the flush request on.
  1220. Flags - Stores flags related to the flush operation. See SYS_FLUSH_FLAG_*
  1221. for definitions.
  1222. --*/
  1223. typedef struct _SYSTEM_CALL_FLUSH {
  1224. HANDLE Handle;
  1225. ULONG Flags;
  1226. } SYSCALL_STRUCT SYSTEM_CALL_FLUSH, *PSYSTEM_CALL_FLUSH;
  1227. /*++
  1228. Structure Description:
  1229. This structure defines the system call parameters for getting resource
  1230. usage for a process or thread.
  1231. Members:
  1232. Request - Stores the request type.
  1233. Id - Stores the process or thread ID to get. Supply -1 to use the current
  1234. process or thread.
  1235. Usage - Stores the returned resource usage from the kernel.
  1236. Frequency - Stores the frequency of the processor(s).
  1237. --*/
  1238. typedef struct _SYSTEM_CALL_GET_RESOURCE_USAGE {
  1239. RESOURCE_USAGE_REQUEST Request;
  1240. PROCESS_ID Id;
  1241. RESOURCE_USAGE Usage;
  1242. ULONGLONG Frequency;
  1243. } SYSCALL_STRUCT SYSTEM_CALL_GET_RESOURCE_USAGE,
  1244. *PSYSTEM_CALL_GET_RESOURCE_USAGE;
  1245. /*++
  1246. Structure Description:
  1247. This structure defines the system call parameters for loading a kernel
  1248. driver.
  1249. Members:
  1250. DriverName - Stores a pointer to a null terminated string containing the
  1251. name of the driver to load.
  1252. DriverNameSize - Stores the size of the driver name buffer in bytes
  1253. including the null terminator.
  1254. --*/
  1255. typedef struct _SYSTEM_CALL_LOAD_DRIVER {
  1256. PSTR DriverName;
  1257. ULONG DriverNameSize;
  1258. } SYSCALL_STRUCT SYSTEM_CALL_LOAD_DRIVER, *PSYSTEM_CALL_LOAD_DRIVER;
  1259. /*++
  1260. Structure Description:
  1261. This structure defines the system call parameters for flushing a region of
  1262. memory after its instruction contents have been modified.
  1263. Members:
  1264. Address - Stores the starting address of the region that was modified.
  1265. Size - Stores the size of the region that was modified in bytes.
  1266. --*/
  1267. typedef struct _SYSTEM_CALL_FLUSH_CACHE {
  1268. PVOID Address;
  1269. UINTN Size;
  1270. } SYSCALL_STRUCT SYSTEM_CALL_FLUSH_CACHE, *PSYSTEM_CALL_FLUSH_CACHE;
  1271. /*++
  1272. Structure Description:
  1273. This structure defines the system call parameters for getting the current
  1274. directory.
  1275. Members:
  1276. Root - Stores a boolean indicating whether to get the path to the current
  1277. working directory (FALSE) or to get the path of the current chroot
  1278. environment (TRUE). If the caller does not have permission to escape
  1279. a changed root, or the root has not been changed, then / is returned
  1280. here.
  1281. Buffer - Stores a pointer to the buffer to hold the current directory's
  1282. path.
  1283. BufferSize - Stores the size of the buffer on input. On output, stores the
  1284. required size of the buffer.
  1285. --*/
  1286. typedef struct _SYSTEM_CALL_GET_CURRENT_DIRECTORY {
  1287. BOOL Root;
  1288. PSTR Buffer;
  1289. UINTN BufferSize;
  1290. } SYSCALL_STRUCT SYSTEM_CALL_GET_CURRENT_DIRECTORY,
  1291. *PSYSTEM_CALL_GET_CURRENT_DIRECTORY;
  1292. /*++
  1293. Structure Description:
  1294. This structure defines the system call parameters for the get/set socket
  1295. information call.
  1296. Members:
  1297. Socket - Stores the handle to the socket to query.
  1298. InformationType - Stores the socket information type category to which the
  1299. specified option belongs.
  1300. Option - Stores the option to get or set, which is specific to the
  1301. information type. The type of this value is generally
  1302. SOCKET_<information_type>_OPTION.
  1303. Data - Stores a pointer to the data buffer where the information will
  1304. be read or written to.
  1305. DataSize - Stores a value that on input contains the size of the data
  1306. buffer in bytes. On output, returns the actual size of the data.
  1307. Set - Stores a boolean indicating whether to set socket information
  1308. (TRUE) or get device information (FALSE).
  1309. --*/
  1310. typedef struct _SYSTEM_CALL_SOCKET_GET_SET_INFORMATION {
  1311. HANDLE Socket;
  1312. SOCKET_INFORMATION_TYPE InformationType;
  1313. UINTN Option;
  1314. PVOID Data;
  1315. UINTN DataSize;
  1316. BOOL Set;
  1317. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_GET_SET_INFORMATION,
  1318. *PSYSTEM_CALL_SOCKET_GET_SET_INFORMATION;
  1319. /*++
  1320. Structure Description:
  1321. This structure defines the system call parameters for partially shutting
  1322. down I/O on a socket.
  1323. Members:
  1324. Socket - Stores the handle to the socket to shut down.
  1325. ShutdownType - Stores the type of shutdown to perform. See
  1326. SOCKET_SHUTDOWN_* flags, which can be ORed together.
  1327. --*/
  1328. typedef struct _SYSTEM_CALL_SOCKET_SHUTDOWN {
  1329. HANDLE Socket;
  1330. ULONG ShutdownType;
  1331. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_SHUTDOWN, *PSYSTEM_CALL_SOCKET_SHUTDOWN;
  1332. /*++
  1333. Structure Description:
  1334. This structure defines the system call parameters for creating a hard link.
  1335. Members:
  1336. ExistingFileDirectory - Stores an optional handle to the directory to
  1337. start path traversal from if the specified existing file path is
  1338. relative. Supply INVALID_HANDLE here to use the current directory for
  1339. relative paths.
  1340. ExistingFilePath - Stores a pointer to a null-terminated string
  1341. containing the path of the existing file to link to.
  1342. ExistingFilePathSize - Stores the size of the existing file path buffer
  1343. in bytes, including the null terminator.
  1344. NewLinkDirectory - Stores an optional handle to the directory to start path
  1345. traversal from if the specified new link path is relative. Supply
  1346. INVALID_HANDLE here to use the current directory for relative paths.
  1347. NewLinkPath - Stores a pointer to the null-terminated string containing
  1348. the path of the new link to create.
  1349. NewLinkPathSize - Stores the size of the new link path buffer in bytes,
  1350. including the null terminator.
  1351. FollowLinks - Stores a boolean indicating whether to follow the link in
  1352. the source (existing file path) if it is a symbolic link.
  1353. --*/
  1354. typedef struct _SYSTEM_CALL_CREATE_HARD_LINK {
  1355. HANDLE ExistingFileDirectory;
  1356. PSTR ExistingFilePath;
  1357. ULONG ExistingFilePathSize;
  1358. HANDLE NewLinkDirectory;
  1359. PSTR NewLinkPath;
  1360. ULONG NewLinkPathSize;
  1361. BOOL FollowLinks;
  1362. } SYSCALL_STRUCT SYSTEM_CALL_CREATE_HARD_LINK, *PSYSTEM_CALL_CREATE_HARD_LINK;
  1363. /*++
  1364. Structure Description:
  1365. This structure defines the system call paramters for mapping a file object
  1366. and then unmapping the object.
  1367. Members:
  1368. Map - Stores a boolean indicating whether or not a map (TRUE) or unmap
  1369. (FALSE) operation is being requested.
  1370. Flags - Stores a bitmask of flags. See SYS_MAP_FLAG_* for definitions.
  1371. Handle - Stores a handle to the file object to be mapped.
  1372. Address - Stores the address pointer. For a map operation, this can contain
  1373. a suggested address for the mapping. On exit it contains the location
  1374. of the mapping. For unmap operations, this contains the starting
  1375. address of the region to be unmapped.
  1376. Offset - Stores the offset, in bytes, of the file object where the
  1377. requested mapping should start.
  1378. Size - Stores the size of the memory region, in bytes. For a map operation
  1379. this stores the requested number of bytes of the file to be mapped,
  1380. starting at the given offset. For an unmap operation, this stores the
  1381. size of the memory region that starts at the given address.
  1382. --*/
  1383. typedef struct _SYSTEM_CALL_MAP_UNMAP_MEMORY {
  1384. BOOL Map;
  1385. ULONG Flags;
  1386. HANDLE Handle;
  1387. PVOID Address;
  1388. ULONGLONG Offset;
  1389. UINTN Size;
  1390. } SYSCALL_STRUCT SYSTEM_CALL_MAP_UNMAP_MEMORY, *PSYSTEM_CALL_MAP_UNMAP_MEMORY;
  1391. /*++
  1392. Structure Description:
  1393. This structure defines the system call parameters for flushing a region of
  1394. memory to the permament storage that backs it, if any.
  1395. Members:
  1396. Address - Stores the starting address of the memory region that is to be
  1397. synchronized.
  1398. Size - Supplies the size, in bytes, of the region to synchronize.
  1399. Flags - Stores a bitmask of flags. See SYS_MAP_SYNC_FLAG_* for definitions.
  1400. --*/
  1401. typedef struct _SYSTEM_CALL_FLUSH_MEMORY {
  1402. PVOID Address;
  1403. ULONGLONG Size;
  1404. ULONG Flags;
  1405. } SYSCALL_STRUCT SYSTEM_CALL_FLUSH_MEMORY, *PSYSTEM_CALL_FLUSH_MEMORY;
  1406. /*++
  1407. Structure Description:
  1408. This structure defines the system call parameters for locating a
  1409. device information registration.
  1410. Members:
  1411. ByDeviceId - Stores a boolean indicating if the search should filter by
  1412. device ID number.
  1413. ByUuid - Stores a boolean indicating if the search should filter by
  1414. the information type identifier.
  1415. DeviceId - Stores the device ID that device information results must
  1416. match against. This is only used if the "by device ID" parameter is
  1417. TRUE.
  1418. Uuid - Stores the information type identifier that the device information
  1419. results must match against. This is only used if the "by UUID"
  1420. parameter is TRUE.
  1421. Results - Stores a pointer to a caller allocated buffer where the results
  1422. will be returned on success.
  1423. ResultCount - Stores a value that on input contains the size of the
  1424. result buffer in elements. On output, returns the number of elements
  1425. in the results, even if the supplied buffer was too small.
  1426. --*/
  1427. typedef struct _SYSTEM_CALL_LOCATE_DEVICE_INFORMATION {
  1428. BOOL ByDeviceId;
  1429. BOOL ByUuid;
  1430. DEVICE_ID DeviceId;
  1431. UUID Uuid;
  1432. PDEVICE_INFORMATION_RESULT Results;
  1433. ULONG ResultCount;
  1434. } SYSCALL_STRUCT SYSTEM_CALL_LOCATE_DEVICE_INFORMATION,
  1435. *PSYSTEM_CALL_LOCATE_DEVICE_INFORMATION;
  1436. /*++
  1437. Structure Description:
  1438. This structure defines the system call parameters for getting or setting
  1439. device information.
  1440. Members:
  1441. DeviceId - Stores the numerical identifier of the device to get or set
  1442. information for.
  1443. Uuid - Stores the device information type identifier.
  1444. Data - Stores a pointer to the data buffer where the information will
  1445. be read or written to.
  1446. DataSize - Stores a value that on input contains the size of the data
  1447. buffer in bytes. On output, returns the actual size of the data.
  1448. Set - Stores a boolean indicating whether to set device information
  1449. (TRUE) or get device information (FALSE).
  1450. --*/
  1451. typedef struct _SYSTEM_CALL_GET_SET_DEVICE_INFORMATION {
  1452. DEVICE_ID DeviceId;
  1453. UUID Uuid;
  1454. PVOID Data;
  1455. UINTN DataSize;
  1456. BOOL Set;
  1457. } SYSCALL_STRUCT SYSTEM_CALL_GET_SET_DEVICE_INFORMATION,
  1458. *PSYSTEM_CALL_GET_SET_DEVICE_INFORMATION;
  1459. /*++
  1460. Structure Description:
  1461. This structure defines the system call parameters for the open device call.
  1462. Members:
  1463. DeviceId - Stores the numerical identifier of the device to open.
  1464. Flags - Stores a bitfield of flags. See SYS_OPEN_FLAG_* definitions.
  1465. Handle - Stores a handle where the handle will be returned on success.
  1466. --*/
  1467. typedef struct _SYSTEM_CALL_OPEN_DEVICE {
  1468. DEVICE_ID DeviceId;
  1469. ULONG Flags;
  1470. HANDLE Handle;
  1471. } SYSCALL_STRUCT SYSTEM_CALL_OPEN_DEVICE, *PSYSTEM_CALL_OPEN_DEVICE;
  1472. /*++
  1473. Structure Description:
  1474. This structure defines the system call parameters for getting or setting
  1475. system information.
  1476. Members:
  1477. Subsystem - Stores the subsystem to query or set information for.
  1478. InformationType - Stores the information type, which is specific to
  1479. the subsystem. The type of this value is generally
  1480. <subsystem>_INFORMATION_TYPE (eg IO_INFORMATION_TYPE).
  1481. Data - Stores a pointer to the data buffer where the information will
  1482. be read or written to.
  1483. DataSize - Stores a value that on input contains the size of the data
  1484. buffer in bytes. On output, returns the actual size of the data.
  1485. Set - Stores a boolean indicating whether to set device information
  1486. (TRUE) or get device information (FALSE).
  1487. --*/
  1488. typedef struct _SYSTEM_CALL_GET_SET_SYSTEM_INFORMATION {
  1489. SYSTEM_INFORMATION_SUBSYSTEM Subsystem;
  1490. UINTN InformationType;
  1491. PVOID Data;
  1492. UINTN DataSize;
  1493. BOOL Set;
  1494. } SYSCALL_STRUCT SYSTEM_CALL_GET_SET_SYSTEM_INFORMATION,
  1495. *PSYSTEM_CALL_GET_SET_SYSTEM_INFORMATION;
  1496. /*++
  1497. Structure Description:
  1498. This structure defines the system call parameters for setting the system
  1499. time.
  1500. Members:
  1501. SystemTime - Stores the system time to set.
  1502. TimeCounter - Stores the time counter value corresponding with the
  1503. moment the system time was meant to be set by the caller.
  1504. --*/
  1505. typedef struct _SYSTEM_CALL_SET_SYSTEM_TIME {
  1506. SYSTEM_TIME SystemTime;
  1507. ULONGLONG TimeCounter;
  1508. } SYSCALL_STRUCT SYSTEM_CALL_SET_SYSTEM_TIME, *PSYSTEM_CALL_SET_SYSTEM_TIME;
  1509. /*++
  1510. Structure Description:
  1511. This structure defines the system call parameters for setting the system
  1512. time.
  1513. Members:
  1514. Address - Stores the starting address (inclusive) to change the memory
  1515. protection for. This must be aligned to a page boundary.
  1516. Length - Stores the length, in bytes, of the region to change attributes
  1517. for.
  1518. NewAttributes - Stores the new attributes to set. See SYS_MAP_FLAG_*
  1519. definitions.
  1520. --*/
  1521. typedef struct _SYSTEM_CALL_SET_MEMORY_PROTECTION {
  1522. PVOID Address;
  1523. UINTN Size;
  1524. ULONG NewAttributes;
  1525. } SYSCALL_STRUCT SYSTEM_CALL_SET_MEMORY_PROTECTION,
  1526. *PSYSTEM_CALL_SET_MEMORY_PROTECTION;
  1527. /*++
  1528. Structure Description:
  1529. This structure defines the system call parameters for getting and setting
  1530. the current thread identity, including the thread's user and group IDs.
  1531. Members:
  1532. Request - Stores the request details of the get or set thread identity
  1533. operation.
  1534. --*/
  1535. typedef struct _SYSTEM_CALL_SET_THREAD_IDENTITY {
  1536. SET_THREAD_IDENTITY Request;
  1537. } SYSCALL_STRUCT SYSTEM_CALL_SET_THREAD_IDENTITY,
  1538. *PSYSTEM_CALL_SET_THREAD_IDENTITY;
  1539. /*++
  1540. Structure Description:
  1541. This structure defines the system call parameters for getting and setting
  1542. the current thread permission masks.
  1543. Members:
  1544. Request - Stores the request details of the get or set thread permissions
  1545. operation.
  1546. --*/
  1547. typedef struct _SYSTEM_CALL_SET_THREAD_PERMISSIONS {
  1548. SET_THREAD_PERMISSIONS Request;
  1549. } SYSCALL_STRUCT SYSTEM_CALL_SET_THREAD_PERMISSIONS,
  1550. *PSYSTEM_CALL_SET_THREAD_PERMISSIONS;
  1551. /*++
  1552. Structure Description:
  1553. This structure defines the system call parameters for getting and setting
  1554. the supplementary group membership of the calling thread.
  1555. Members:
  1556. Set - Stores a boolean indicating if the caller wants to set the
  1557. supplementary group membership or just get it.
  1558. Groups - Stores a pointer to an array where the supplementary group IDs
  1559. will be returned on read, or the buffer containing the new IDs on
  1560. writes. This buffer does not contain the primary real/effective/saved
  1561. group IDs.
  1562. Count - Stores the number of elements the buffer stores on input, on output,
  1563. returns the number of elements in the buffer (or needed if the buffer
  1564. was not large enough).
  1565. --*/
  1566. typedef struct _SYSTEM_CALL_SET_SUPPLEMENTARY_GROUPS {
  1567. BOOL Set;
  1568. PGROUP_ID Groups;
  1569. UINTN Count;
  1570. } SYSCALL_STRUCT SYSTEM_CALL_SET_SUPPLEMENTARY_GROUPS,
  1571. *PSYSTEM_CALL_SET_SUPPLEMENTARY_GROUPS;
  1572. /*++
  1573. Structure Description:
  1574. This structure defines the system call parameters for creating a pair of
  1575. connected sockets.
  1576. Members:
  1577. Domain - Stores the network domain to use on the sockets.
  1578. Type - Stores the socket connection type.
  1579. Protocol - Stores the raw network protocol to use on the socket.
  1580. These are network specific. For example, for IPv4 and IPv6, the values
  1581. are taken from the Internet Assigned Numbers Authority (IANA).
  1582. OpenFlags - Stores an optional bitfield of open flags for the new socket.
  1583. Only SYS_OPEN_FLAG_NON_BLOCKING and SYS_OPEN_FLAG_CLOSE_ON_EXECUTE
  1584. are accepted.
  1585. Socket1 - Stores one of the returned socket file descriptor on success.
  1586. Socket2 - Stores the other returned socket file descriptor on success.
  1587. --*/
  1588. typedef struct _SYSTEM_CALL_SOCKET_CREATE_PAIR {
  1589. NET_DOMAIN_TYPE Domain;
  1590. NET_SOCKET_TYPE Type;
  1591. ULONG Protocol;
  1592. ULONG OpenFlags;
  1593. HANDLE Socket1;
  1594. HANDLE Socket2;
  1595. } SYSCALL_STRUCT SYSTEM_CALL_SOCKET_CREATE_PAIR,
  1596. *PSYSTEM_CALL_SOCKET_CREATE_PAIR;
  1597. /*++
  1598. Structure Description:
  1599. This structure defines the system call parameters for creating a new
  1600. pseudo-terminal device.
  1601. Members:
  1602. MasterDirectory - Stores an optional handle to a directory for relative
  1603. paths when creating the master. Supply INVALID_HANDLE to use the
  1604. current working directory.
  1605. SlaveDirectory - Stores an optional handle to a directory for relative
  1606. paths when creating the slave. Supply INVALID_HANDLE to use the
  1607. current working directory.
  1608. MasterPath - Stores an optional pointer to the path to create for the
  1609. master.
  1610. MasterPathLength - Stores the length of the master side path buffer in
  1611. bytes, including the null terminator.
  1612. SlavePath - Stores an optional pointer to the path to create for the
  1613. master.
  1614. SlavePathLength - Stores the length of the slave side path buffer in
  1615. bytes, including the null terminator.
  1616. MasterOpenFlags - Stores the open flags to use when opening the master.
  1617. Only read, write, and "no controlling terminal" flags are honored.
  1618. MasterCreatePermissions - Stores the permissions to apply to the created
  1619. master side.
  1620. SlaveCreatePermissions - Stores the permission to apply to the created
  1621. slave side.
  1622. MasterHandle - Stores the returned handle to the master terminal side on
  1623. success.
  1624. --*/
  1625. typedef struct _SYSTEM_CALL_CREATE_TERMINAL {
  1626. HANDLE MasterDirectory;
  1627. HANDLE SlaveDirectory;
  1628. PSTR MasterPath;
  1629. UINTN MasterPathLength;
  1630. PSTR SlavePath;
  1631. UINTN SlavePathLength;
  1632. ULONG MasterOpenFlags;
  1633. FILE_PERMISSIONS MasterCreatePermissions;
  1634. FILE_PERMISSIONS SlaveCreatePermissions;
  1635. HANDLE MasterHandle;
  1636. } SYSCALL_STRUCT SYSTEM_CALL_CREATE_TERMINAL, *PSYSTEM_CALL_CREATE_TERMINAL;
  1637. /*++
  1638. Structure Description:
  1639. This structure defines the system call parameters for the user lock
  1640. operation, which provides basic synchronization building blocks to user
  1641. mode.
  1642. Members:
  1643. Address - Stores a pointer to the address of the lock.
  1644. Value - Stores the value, whose meaning depends on the lock operation.
  1645. Operation - Stores the type of operation to perform on the lock. This is of
  1646. type USER_LOCK_OPERATION, but is also combined with USER_LOCK_* flags.
  1647. TimeoutInMilliseconds - Stores the timeout in milliseconds the caller
  1648. should wait. Set to SYS_WAIT_TIME_INDEFINITE to wait forever.
  1649. --*/
  1650. typedef struct _SYSTEM_CALL_USER_LOCK {
  1651. PULONG Address;
  1652. ULONG Value;
  1653. ULONG Operation;
  1654. ULONG TimeoutInMilliseconds;
  1655. } SYSCALL_STRUCT SYSTEM_CALL_USER_LOCK, *PSYSTEM_CALL_USER_LOCK;
  1656. /*++
  1657. Structure Description:
  1658. This structure defines the system call parameters for the set umask system
  1659. call. The umask is the set of permission bits that cannot be set on
  1660. newly created files or directories.
  1661. Members:
  1662. Mask - Supplies the new mask to set on input. On output, contains the old
  1663. mask.
  1664. --*/
  1665. typedef struct _SYSTEM_CALL_SET_UMASK {
  1666. FILE_PERMISSIONS Mask;
  1667. } SYSCALL_STRUCT SYSTEM_CALL_SET_UMASK, *PSYSTEM_CALL_SET_UMASK;
  1668. /*++
  1669. Structure Description:
  1670. This structure defines the system call parameters for duplicating a handle.
  1671. Members:
  1672. OldHandle - Stores the handle to be duplicated.
  1673. NewHandle - Stores the destination handle value for the new handle. If this
  1674. is INVALID_HANDLE, then the duplicated handle will be the lowest
  1675. available handle value, and will be returned here. If this is not
  1676. INVALID_HANDLE, then the previous handle at that location will be
  1677. closed. If the new handle equals the existing handle, failure is
  1678. returned.
  1679. OpenFlags - Stores open flags to be set on the new handle. Only
  1680. SYS_OPEN_FLAG_CLOSE_ON_EXECUTE is permitted. If not set, the new handle
  1681. will have the close on execute flag cleared.
  1682. --*/
  1683. typedef struct _SYSTEM_CALL_DUPLICATE_HANDLE {
  1684. HANDLE OldHandle;
  1685. HANDLE NewHandle;
  1686. ULONG OpenFlags;
  1687. } SYSCALL_STRUCT SYSTEM_CALL_DUPLICATE_HANDLE, *PSYSTEM_CALL_DUPLICATE_HANDLE;
  1688. /*++
  1689. Structure Description:
  1690. This structure defines the system call parameters for getting or setting an
  1691. interval timer.
  1692. Members:
  1693. Type - Stores the type of timer to get or set.
  1694. Set - Stores a boolean indicating whether to get the current timer
  1695. expiration information (FALSE) or set it (TRUE).
  1696. DueTime - Stores the relative due time to set for a set operation. For both
  1697. get and set operations, returns the previous due time. Zero means
  1698. disabled. The units here are processor counter ticks for profile and
  1699. virtual timers, or time counter ticks for real timers.
  1700. Period - Stores the periodic interval to set for a set operation. For both
  1701. get and set operations, returns the previous interval period. Zero
  1702. means non-periodic. Units here are processor counter ticks for profile
  1703. and virtual timers, or time counter ticks for real timers.
  1704. --*/
  1705. typedef struct _SYSTEM_CALL_SET_ITIMER {
  1706. ITIMER_TYPE Type;
  1707. BOOL Set;
  1708. ULONGLONG DueTime;
  1709. ULONGLONG Period;
  1710. } SYSCALL_STRUCT SYSTEM_CALL_SET_ITIMER, *PSYSTEM_CALL_SET_ITIMER;
  1711. /*++
  1712. Structure Description:
  1713. This structure defines the system call parameters for getting or setting
  1714. the program break address. Increasing the program break dynamically gives
  1715. the application more memory, usually used for the heap.
  1716. Members:
  1717. Break - Stores the new break address to set. If this is greater than the
  1718. original program, then the kernel will attempt to set the given
  1719. break address, subject to memory limitations. If this is NULL or less
  1720. than the original break, the kernel will not attempt a set. Returns
  1721. the current program break.
  1722. --*/
  1723. typedef struct _SYSTEM_CALL_SET_BREAK {
  1724. PVOID Break;
  1725. } SYSCALL_STRUCT SYSTEM_CALL_SET_BREAK, *PSYSTEM_CALL_SET_BREAK;
  1726. /*++
  1727. Structure Description:
  1728. This structure defines the system call parameters for getting or setting
  1729. the current thread's resource limits.
  1730. Members:
  1731. Type - Stores the type of resource limit to get or set.
  1732. Set - Stores a boolean indicating whether to get the resource limit (FALSE)
  1733. or set it (TRUE).
  1734. Value - Stores the new value to set for set operations on input. Returns
  1735. the previous value that was set for the limit.
  1736. Status - Stores the resulting status code returned by the kernel.
  1737. --*/
  1738. typedef struct _SYSTEM_CALL_SET_RESOURCE_LIMIT {
  1739. RESOURCE_LIMIT_TYPE Type;
  1740. BOOL Set;
  1741. RESOURCE_LIMIT Value;
  1742. } SYSCALL_STRUCT SYSTEM_CALL_SET_RESOURCE_LIMIT,
  1743. *PSYSTEM_CALL_SET_RESOURCE_LIMIT;
  1744. /*++
  1745. Structure Description:
  1746. This structure defines a union of all possible system call parameter
  1747. structures. The size of this structure acts as an upper bound for the
  1748. required space neede to make a stack local copy of the user mode parameters.
  1749. Members:
  1750. Stores every possible system call parameter structure.
  1751. --*/
  1752. typedef union _SYSTEM_CALL_PARAMETER_UNION {
  1753. SYSTEM_CALL_FORK Fork;
  1754. SYSTEM_CALL_EXIT_THREAD ExitThread;
  1755. SYSTEM_CALL_OPEN Open;
  1756. SYSTEM_CALL_PERFORM_IO PerformIo;
  1757. SYSTEM_CALL_PERFORM_VECTORED_IO PerformVectoredIo;
  1758. SYSTEM_CALL_CREATE_PIPE CreatePipe;
  1759. SYSTEM_CALL_CREATE_THREAD CreateThread;
  1760. SYSTEM_CALL_EXECUTE_IMAGE ExecuteImage;
  1761. SYSTEM_CALL_CHANGE_DIRECTORY ChangeDirectory;
  1762. SYSTEM_CALL_SET_SIGNAL_HANDLER SetSignalHandler;
  1763. SYSTEM_CALL_SEND_SIGNAL SendSignal;
  1764. SYSTEM_CALL_GET_SET_PROCESS_ID GetSetProcessId;
  1765. SYSTEM_CALL_SET_SIGNAL_BEHAVIOR SetSignalBehavior;
  1766. SYSTEM_CALL_WAIT_FOR_CHILD WaitForChild;
  1767. SYSTEM_CALL_SUSPEND_EXECUTION SuspendExecution;
  1768. SYSTEM_CALL_POLL Poll;
  1769. SYSTEM_CALL_SOCKET_CREATE SocketCreate;
  1770. SYSTEM_CALL_SOCKET_BIND SocketBind;
  1771. SYSTEM_CALL_SOCKET_LISTEN SocketListen;
  1772. SYSTEM_CALL_SOCKET_ACCEPT SocketAccept;
  1773. SYSTEM_CALL_SOCKET_CONNECT SocketConnect;
  1774. SYSTEM_CALL_SOCKET_PERFORM_IO SocketPerformIo;
  1775. SYSTEM_CALL_FILE_CONTROL FileControl;
  1776. SYSTEM_CALL_GET_SET_FILE_INFORMATION GetSetFileInformation;
  1777. SYSTEM_CALL_DEBUG Debug;
  1778. SYSTEM_CALL_SEEK Seek;
  1779. SYSTEM_CALL_CREATE_SYMBOLIC_LINK CreateSymbolicLink;
  1780. SYSTEM_CALL_READ_SYMBOLIC_LINK ReadSymbolicLink;
  1781. SYSTEM_CALL_DELETE Delete;
  1782. SYSTEM_CALL_RENAME Rename;
  1783. SYSTEM_CALL_MOUNT_UNMOUNT MountUnmount;
  1784. SYSTEM_CALL_QUERY_TIME_COUNTER QueryTimeCounter;
  1785. SYSTEM_CALL_TIMER_CONTROL TimerControl;
  1786. SYSTEM_CALL_GET_EFFECTIVE_ACCESS GetEffectiveAccess;
  1787. SYSTEM_CALL_DELAY_EXECUTION DelayExecution;
  1788. SYSTEM_CALL_USER_CONTROL UserControl;
  1789. SYSTEM_CALL_FLUSH Flush;
  1790. SYSTEM_CALL_GET_RESOURCE_USAGE GetResourceUsage;
  1791. SYSTEM_CALL_LOAD_DRIVER LoadDriver;
  1792. SYSTEM_CALL_FLUSH_CACHE FlushCache;
  1793. SYSTEM_CALL_GET_CURRENT_DIRECTORY GetCurrentDirectory;
  1794. SYSTEM_CALL_SOCKET_GET_SET_INFORMATION GetSetSocketInformation;
  1795. SYSTEM_CALL_SOCKET_SHUTDOWN SocketShutdown;
  1796. SYSTEM_CALL_CREATE_HARD_LINK CreateHardLink;
  1797. SYSTEM_CALL_MAP_UNMAP_MEMORY MapUnmapMemory;
  1798. SYSTEM_CALL_FLUSH_MEMORY FlushMemory;
  1799. SYSTEM_CALL_LOCATE_DEVICE_INFORMATION LocateDeviceInformation;
  1800. SYSTEM_CALL_GET_SET_DEVICE_INFORMATION GetSetDeviceInformation;
  1801. SYSTEM_CALL_OPEN_DEVICE OpenDevice;
  1802. SYSTEM_CALL_GET_SET_SYSTEM_INFORMATION GetSetSystemInformation;
  1803. SYSTEM_CALL_SET_SYSTEM_TIME SetSystemTime;
  1804. SYSTEM_CALL_SET_MEMORY_PROTECTION SetMemoryProtection;
  1805. SYSTEM_CALL_SET_THREAD_IDENTITY SetThreadIdentity;
  1806. SYSTEM_CALL_SET_THREAD_PERMISSIONS SetThreadPermissions;
  1807. SYSTEM_CALL_SET_SUPPLEMENTARY_GROUPS SetSupplementaryGroups;
  1808. SYSTEM_CALL_SOCKET_CREATE_PAIR SocketCreatePair;
  1809. SYSTEM_CALL_CREATE_TERMINAL CreateTerminal;
  1810. SYSTEM_CALL_SOCKET_PERFORM_VECTORED_IO SocketPerformVectoredIo;
  1811. SYSTEM_CALL_USER_LOCK UserLock;
  1812. SYSTEM_CALL_SET_UMASK SetUmask;
  1813. SYSTEM_CALL_DUPLICATE_HANDLE DuplicateHandle;
  1814. SYSTEM_CALL_SET_ITIMER SetITimer;
  1815. SYSTEM_CALL_SET_RESOURCE_LIMIT SetResourceLimit;
  1816. SYSTEM_CALL_SET_BREAK SetBreak;
  1817. } SYSCALL_STRUCT SYSTEM_CALL_PARAMETER_UNION, *PSYSTEM_CALL_PARAMETER_UNION;
  1818. typedef
  1819. INTN
  1820. (*PSYSTEM_CALL_ROUTINE) (
  1821. PVOID SystemCallParameter
  1822. );
  1823. /*++
  1824. Routine Description:
  1825. This routine implements the kernel mode functionality behind a particular
  1826. system call.
  1827. Arguments:
  1828. SystemCallParameter - Supplies a pointer to the parameters supplied with
  1829. the system call. This structure will be a stack-local copy of the
  1830. actual parameters passed from user-mode.
  1831. Return Value:
  1832. STATUS_SUCCESS or positive integer on success.
  1833. Error status code on failure.
  1834. --*/
  1835. //
  1836. // -------------------------------------------------------------------- Globals
  1837. //
  1838. //
  1839. // -------------------------------------------------------- Function Prototypes
  1840. //