protocol.def 125 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719
  1. /* -*- C -*-
  2. *
  3. * Wine server protocol definition
  4. *
  5. * Copyright (C) 2001 Alexandre Julliard
  6. *
  7. * This file is used by tools/make_requests to build the
  8. * protocol structures in include/wine/server_protocol.h
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. @HEADER /* start of C declarations */
  25. #include <stdarg.h>
  26. #include <stdlib.h>
  27. #include <time.h>
  28. #include <windef.h>
  29. #include <winbase.h>
  30. typedef unsigned int obj_handle_t;
  31. typedef unsigned int user_handle_t;
  32. typedef unsigned int atom_t;
  33. typedef unsigned int process_id_t;
  34. typedef unsigned int thread_id_t;
  35. typedef unsigned int data_size_t;
  36. typedef unsigned int ioctl_code_t;
  37. typedef unsigned __int64 lparam_t;
  38. typedef unsigned __int64 apc_param_t;
  39. typedef unsigned __int64 mem_size_t;
  40. typedef unsigned __int64 file_pos_t;
  41. typedef unsigned __int64 client_ptr_t;
  42. typedef unsigned __int64 affinity_t;
  43. typedef client_ptr_t mod_handle_t;
  44. struct request_header
  45. {
  46. int req; /* request code */
  47. data_size_t request_size; /* request variable part size */
  48. data_size_t reply_size; /* reply variable part maximum size */
  49. };
  50. struct reply_header
  51. {
  52. unsigned int error; /* error result */
  53. data_size_t reply_size; /* reply variable part size */
  54. };
  55. /* placeholder structure for the maximum allowed request size */
  56. /* this is used to construct the generic_request union */
  57. struct request_max_size
  58. {
  59. int pad[16]; /* the max request size is 16 ints */
  60. };
  61. #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
  62. #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
  63. /* debug event data */
  64. typedef union
  65. {
  66. int code; /* event code */
  67. struct
  68. {
  69. int code; /* DbgExceptionStateChange */
  70. int first; /* first chance exception? */
  71. unsigned int exc_code; /* exception code */
  72. unsigned int flags; /* exception flags */
  73. client_ptr_t record; /* exception record */
  74. client_ptr_t address; /* exception address */
  75. int nb_params; /* number of parameters */
  76. int __pad;
  77. client_ptr_t params[15]; /* parameters */
  78. } exception;
  79. struct
  80. {
  81. int code; /* DbgCreateThreadStateChange */
  82. obj_handle_t handle; /* handle to the new thread */
  83. client_ptr_t start; /* thread startup routine */
  84. } create_thread;
  85. struct
  86. {
  87. int code; /* DbgCreateProcessStateChange */
  88. obj_handle_t file; /* handle to the process exe file */
  89. obj_handle_t process; /* handle to the new process */
  90. obj_handle_t thread; /* handle to the new thread */
  91. mod_handle_t base; /* base of executable image */
  92. int dbg_offset; /* offset of debug info in file */
  93. int dbg_size; /* size of debug info */
  94. client_ptr_t start; /* thread startup routine */
  95. } create_process;
  96. struct
  97. {
  98. int code; /* DbgExitThreadStateChange/DbgExitProcessStateChange */
  99. int exit_code; /* thread or process exit code */
  100. } exit;
  101. struct
  102. {
  103. int code; /* DbgLoadDllStateChange */
  104. obj_handle_t handle; /* file handle for the dll */
  105. mod_handle_t base; /* base address of the dll */
  106. int dbg_offset; /* offset of debug info in file */
  107. int dbg_size; /* size of debug info */
  108. client_ptr_t name; /* image name (optional) */
  109. } load_dll;
  110. struct
  111. {
  112. int code; /* DbgUnloadDllStateChange */
  113. int __pad;
  114. mod_handle_t base; /* base address of the dll */
  115. } unload_dll;
  116. } debug_event_t;
  117. /* context data */
  118. typedef struct
  119. {
  120. unsigned int machine; /* machine type */
  121. unsigned int flags; /* SERVER_CTX_* flags */
  122. union
  123. {
  124. struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
  125. struct { unsigned __int64 rip, rbp, rsp;
  126. unsigned int cs, ss, flags, __pad; } x86_64_regs;
  127. struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
  128. struct { unsigned __int64 sp, pc, pstate; } arm64_regs;
  129. } ctl; /* selected by SERVER_CTX_CONTROL */
  130. union
  131. {
  132. struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
  133. struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
  134. r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
  135. struct { unsigned int r[13]; } arm_regs;
  136. struct { unsigned __int64 x[31]; } arm64_regs;
  137. } integer; /* selected by SERVER_CTX_INTEGER */
  138. union
  139. {
  140. struct { unsigned int ds, es, fs, gs; } i386_regs;
  141. struct { unsigned int ds, es, fs, gs; } x86_64_regs;
  142. } seg; /* selected by SERVER_CTX_SEGMENTS */
  143. union
  144. {
  145. struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
  146. unsigned char regs[80]; } i386_regs;
  147. struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
  148. struct { unsigned __int64 d[32]; unsigned int fpscr; } arm_regs;
  149. struct { struct { unsigned __int64 low, high; } q[32]; unsigned int fpcr, fpsr; } arm64_regs;
  150. } fp; /* selected by SERVER_CTX_FLOATING_POINT */
  151. union
  152. {
  153. struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
  154. struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
  155. struct { unsigned int bvr[8], bcr[8], wvr[1], wcr[1]; } arm_regs;
  156. struct { unsigned __int64 bvr[8], wvr[2]; unsigned int bcr[8], wcr[2]; } arm64_regs;
  157. } debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
  158. union
  159. {
  160. unsigned char i386_regs[512];
  161. } ext; /* selected by SERVER_CTX_EXTENDED_REGISTERS */
  162. union
  163. {
  164. struct { struct { unsigned __int64 low, high; } ymm_high[16]; } regs;
  165. } ymm; /* selected by SERVER_CTX_YMM_REGISTERS */
  166. } context_t;
  167. #define SERVER_CTX_CONTROL 0x01
  168. #define SERVER_CTX_INTEGER 0x02
  169. #define SERVER_CTX_SEGMENTS 0x04
  170. #define SERVER_CTX_FLOATING_POINT 0x08
  171. #define SERVER_CTX_DEBUG_REGISTERS 0x10
  172. #define SERVER_CTX_EXTENDED_REGISTERS 0x20
  173. #define SERVER_CTX_YMM_REGISTERS 0x40
  174. /* structure used in sending an fd from client to server */
  175. struct send_fd
  176. {
  177. thread_id_t tid; /* thread id */
  178. int fd; /* file descriptor on client-side */
  179. };
  180. /* structure sent by the server on the wait fifo */
  181. struct wake_up_reply
  182. {
  183. client_ptr_t cookie; /* magic cookie that was passed in select_request */
  184. int signaled; /* wait result */
  185. int __pad;
  186. };
  187. /* NT-style timeout, in 100ns units, negative means relative timeout */
  188. typedef __int64 timeout_t;
  189. #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
  190. /* absolute timeout, negative means that monotonic clock is used */
  191. typedef __int64 abstime_t;
  192. /* structure for process startup info */
  193. typedef struct
  194. {
  195. unsigned int debug_flags;
  196. unsigned int console_flags;
  197. obj_handle_t console;
  198. obj_handle_t hstdin;
  199. obj_handle_t hstdout;
  200. obj_handle_t hstderr;
  201. unsigned int x;
  202. unsigned int y;
  203. unsigned int xsize;
  204. unsigned int ysize;
  205. unsigned int xchars;
  206. unsigned int ychars;
  207. unsigned int attribute;
  208. unsigned int flags;
  209. unsigned int show;
  210. data_size_t curdir_len;
  211. data_size_t dllpath_len;
  212. data_size_t imagepath_len;
  213. data_size_t cmdline_len;
  214. data_size_t title_len;
  215. data_size_t desktop_len;
  216. data_size_t shellinfo_len;
  217. data_size_t runtime_len;
  218. /* VARARG(curdir,unicode_str,curdir_len); */
  219. /* VARARG(dllpath,unicode_str,dllpath_len); */
  220. /* VARARG(imagepath,unicode_str,imagepath_len); */
  221. /* VARARG(cmdline,unicode_str,cmdline_len); */
  222. /* VARARG(title,unicode_str,title_len); */
  223. /* VARARG(desktop,unicode_str,desktop_len); */
  224. /* VARARG(shellinfo,unicode_str,shellinfo_len); */
  225. /* VARARG(runtime,unicode_str,runtime_len); */
  226. } startup_info_t;
  227. /* structure returned in the list of window properties */
  228. typedef struct
  229. {
  230. atom_t atom; /* property atom */
  231. int string; /* was atom a string originally? */
  232. lparam_t data; /* data stored in property */
  233. } property_data_t;
  234. /* structure to specify window rectangles */
  235. typedef struct
  236. {
  237. int left;
  238. int top;
  239. int right;
  240. int bottom;
  241. } rectangle_t;
  242. /* structure for parameters of async I/O calls */
  243. typedef struct
  244. {
  245. obj_handle_t handle; /* object to perform I/O on */
  246. obj_handle_t event; /* event to signal when done */
  247. client_ptr_t iosb; /* I/O status block in client addr space */
  248. client_ptr_t user; /* opaque user data containing callback pointer and async-specific data */
  249. client_ptr_t apc; /* user APC to call */
  250. apc_param_t apc_context; /* user APC context or completion value */
  251. } async_data_t;
  252. /* structures for extra message data */
  253. struct hw_msg_source
  254. {
  255. unsigned int device; /* source device (IMDT_* values) */
  256. unsigned int origin; /* source origin (IMO_* values) */
  257. };
  258. union rawinput
  259. {
  260. int type;
  261. struct
  262. {
  263. int type; /* RIM_TYPEKEYBOARD */
  264. unsigned int message; /* message generated by this rawinput event */
  265. unsigned short vkey; /* virtual key code */
  266. unsigned short scan; /* scan code */
  267. } kbd;
  268. struct
  269. {
  270. int type; /* RIM_TYPEMOUSE */
  271. int x; /* x coordinate */
  272. int y; /* y coordinate */
  273. unsigned int data; /* mouse data */
  274. } mouse;
  275. struct
  276. {
  277. int type; /* RIM_TYPEHID */
  278. unsigned int device; /* rawinput device index */
  279. unsigned int param; /* rawinput message param */
  280. unsigned short usage_page;/* HID usage page */
  281. unsigned short usage; /* HID usage */
  282. unsigned int count; /* HID report count */
  283. unsigned int length; /* HID report length */
  284. } hid;
  285. };
  286. struct hardware_msg_data
  287. {
  288. lparam_t info; /* extra info */
  289. data_size_t size; /* size of hardware message data */
  290. int __pad;
  291. unsigned int hw_id; /* unique id */
  292. unsigned int flags; /* hook flags */
  293. struct hw_msg_source source; /* message source */
  294. union rawinput rawinput; /* rawinput message data */
  295. };
  296. struct callback_msg_data
  297. {
  298. client_ptr_t callback; /* callback function */
  299. lparam_t data; /* user data for callback */
  300. lparam_t result; /* message result */
  301. };
  302. struct winevent_msg_data
  303. {
  304. user_handle_t hook; /* hook handle */
  305. thread_id_t tid; /* thread id */
  306. client_ptr_t hook_proc; /* hook proc address */
  307. /* followed by module name if any */
  308. };
  309. typedef union
  310. {
  311. int type;
  312. struct
  313. {
  314. int type; /* INPUT_KEYBOARD */
  315. unsigned short vkey; /* virtual key code */
  316. unsigned short scan; /* scan code */
  317. unsigned int flags; /* event flags */
  318. unsigned int time; /* event time */
  319. lparam_t info; /* extra info */
  320. } kbd;
  321. struct
  322. {
  323. int type; /* INPUT_MOUSE */
  324. int x; /* coordinates */
  325. int y;
  326. unsigned int data; /* mouse data */
  327. unsigned int flags; /* event flags */
  328. unsigned int time; /* event time */
  329. lparam_t info; /* extra info */
  330. } mouse;
  331. struct
  332. {
  333. int type; /* INPUT_HARDWARE */
  334. unsigned int msg; /* message code */
  335. lparam_t lparam; /* message param */
  336. union rawinput rawinput;/* rawinput message data */
  337. } hw;
  338. } hw_input_t;
  339. typedef union
  340. {
  341. unsigned char bytes[1]; /* raw data for sent messages */
  342. struct hardware_msg_data hardware;
  343. struct callback_msg_data callback;
  344. struct winevent_msg_data winevent;
  345. } message_data_t;
  346. /* structure returned in filesystem events */
  347. struct filesystem_event
  348. {
  349. int action;
  350. data_size_t len;
  351. char name[1];
  352. };
  353. typedef struct
  354. {
  355. unsigned int low_part;
  356. int high_part;
  357. } luid_t;
  358. typedef struct
  359. {
  360. unsigned int read;
  361. unsigned int write;
  362. unsigned int exec;
  363. unsigned int all;
  364. } generic_map_t;
  365. #define MAX_ACL_LEN 65535
  366. struct security_descriptor
  367. {
  368. unsigned int control; /* SE_ flags */
  369. data_size_t owner_len;
  370. data_size_t group_len;
  371. data_size_t sacl_len;
  372. data_size_t dacl_len;
  373. /* VARARG(owner,SID); */
  374. /* VARARG(group,SID); */
  375. /* VARARG(sacl,ACL); */
  376. /* VARARG(dacl,ACL); */
  377. };
  378. struct object_attributes
  379. {
  380. obj_handle_t rootdir; /* root directory */
  381. unsigned int attributes; /* object attributes */
  382. data_size_t sd_len; /* length of security_descriptor data. may be 0 */
  383. data_size_t name_len; /* length of the name string. may be 0 */
  384. /* VARARG(sd,security_descriptor); */
  385. /* VARARG(name,unicode_str); */
  386. };
  387. struct object_type_info
  388. {
  389. data_size_t name_len; /* length of the name string */
  390. unsigned int index; /* type index in global table */
  391. unsigned int obj_count; /* count of objects of this type */
  392. unsigned int handle_count; /* count of handles of this type */
  393. unsigned int obj_max; /* max count of objects of this type */
  394. unsigned int handle_max; /* max count of handles of this type */
  395. unsigned int valid_access; /* mask for valid access bits */
  396. generic_map_t mapping; /* generic access mappings */
  397. /* VARARG(name,unicode_str); */
  398. };
  399. struct token_groups
  400. {
  401. unsigned int count;
  402. /* unsigned int attributes[count]; */
  403. /* VARARG(sids,SID); */
  404. };
  405. enum select_op
  406. {
  407. SELECT_NONE,
  408. SELECT_WAIT,
  409. SELECT_WAIT_ALL,
  410. SELECT_SIGNAL_AND_WAIT,
  411. SELECT_KEYED_EVENT_WAIT,
  412. SELECT_KEYED_EVENT_RELEASE
  413. };
  414. typedef union
  415. {
  416. enum select_op op;
  417. struct
  418. {
  419. enum select_op op; /* SELECT_WAIT or SELECT_WAIT_ALL */
  420. obj_handle_t handles[MAXIMUM_WAIT_OBJECTS];
  421. } wait;
  422. struct
  423. {
  424. enum select_op op; /* SELECT_SIGNAL_AND_WAIT */
  425. obj_handle_t wait;
  426. obj_handle_t signal; /* must be last in the structure so we can remove it on retries */
  427. } signal_and_wait;
  428. struct
  429. {
  430. enum select_op op; /* SELECT_KEYED_EVENT_WAIT or SELECT_KEYED_EVENT_RELEASE */
  431. obj_handle_t handle;
  432. client_ptr_t key;
  433. } keyed_event;
  434. } select_op_t;
  435. enum apc_type
  436. {
  437. APC_NONE,
  438. APC_USER,
  439. APC_ASYNC_IO,
  440. APC_VIRTUAL_ALLOC,
  441. APC_VIRTUAL_FREE,
  442. APC_VIRTUAL_QUERY,
  443. APC_VIRTUAL_PROTECT,
  444. APC_VIRTUAL_FLUSH,
  445. APC_VIRTUAL_LOCK,
  446. APC_VIRTUAL_UNLOCK,
  447. APC_MAP_VIEW,
  448. APC_UNMAP_VIEW,
  449. APC_CREATE_THREAD,
  450. APC_DUP_HANDLE
  451. };
  452. typedef struct
  453. {
  454. enum apc_type type; /* APC_USER */
  455. int __pad;
  456. client_ptr_t func; /* void (__stdcall *func)(ULONG_PTR,ULONG_PTR,ULONG_PTR); */
  457. apc_param_t args[3]; /* arguments for user function */
  458. } user_apc_t;
  459. typedef union
  460. {
  461. enum apc_type type;
  462. user_apc_t user;
  463. struct
  464. {
  465. enum apc_type type; /* APC_ASYNC_IO */
  466. unsigned int status; /* I/O status */
  467. client_ptr_t user; /* user pointer */
  468. client_ptr_t sb; /* status block */
  469. data_size_t result; /* result size */
  470. } async_io;
  471. struct
  472. {
  473. enum apc_type type; /* APC_VIRTUAL_ALLOC */
  474. unsigned int op_type; /* type of operation */
  475. client_ptr_t addr; /* requested address */
  476. mem_size_t size; /* allocation size */
  477. mem_size_t zero_bits; /* number of zero high bits */
  478. unsigned int prot; /* memory protection flags */
  479. } virtual_alloc;
  480. struct
  481. {
  482. enum apc_type type; /* APC_VIRTUAL_FREE */
  483. unsigned int op_type; /* type of operation */
  484. client_ptr_t addr; /* requested address */
  485. mem_size_t size; /* allocation size */
  486. } virtual_free;
  487. struct
  488. {
  489. enum apc_type type; /* APC_VIRTUAL_QUERY */
  490. int __pad;
  491. client_ptr_t addr; /* requested address */
  492. } virtual_query;
  493. struct
  494. {
  495. enum apc_type type; /* APC_VIRTUAL_PROTECT */
  496. unsigned int prot; /* new protection flags */
  497. client_ptr_t addr; /* requested address */
  498. mem_size_t size; /* requested size */
  499. } virtual_protect;
  500. struct
  501. {
  502. enum apc_type type; /* APC_VIRTUAL_FLUSH */
  503. int __pad;
  504. client_ptr_t addr; /* requested address */
  505. mem_size_t size; /* requested size */
  506. } virtual_flush;
  507. struct
  508. {
  509. enum apc_type type; /* APC_VIRTUAL_LOCK */
  510. int __pad;
  511. client_ptr_t addr; /* requested address */
  512. mem_size_t size; /* requested size */
  513. } virtual_lock;
  514. struct
  515. {
  516. enum apc_type type; /* APC_VIRTUAL_UNLOCK */
  517. int __pad;
  518. client_ptr_t addr; /* requested address */
  519. mem_size_t size; /* requested size */
  520. } virtual_unlock;
  521. struct
  522. {
  523. enum apc_type type; /* APC_MAP_VIEW */
  524. obj_handle_t handle; /* mapping handle */
  525. client_ptr_t addr; /* requested address */
  526. mem_size_t size; /* allocation size */
  527. file_pos_t offset; /* file offset */
  528. mem_size_t zero_bits; /* number of zero high bits */
  529. unsigned int alloc_type; /* allocation type */
  530. unsigned int prot; /* memory protection flags */
  531. } map_view;
  532. struct
  533. {
  534. enum apc_type type; /* APC_UNMAP_VIEW */
  535. int __pad;
  536. client_ptr_t addr; /* view address */
  537. } unmap_view;
  538. struct
  539. {
  540. enum apc_type type; /* APC_CREATE_THREAD */
  541. unsigned int flags; /* creation flags */
  542. client_ptr_t func; /* void (__stdcall *func)(void*); start function */
  543. client_ptr_t arg; /* argument for start function */
  544. mem_size_t zero_bits; /* number of zero high bits for thread stack */
  545. mem_size_t reserve; /* reserve size for thread stack */
  546. mem_size_t commit; /* commit size for thread stack */
  547. } create_thread;
  548. struct
  549. {
  550. enum apc_type type; /* APC_DUP_HANDLE */
  551. obj_handle_t src_handle; /* src handle to duplicate */
  552. obj_handle_t dst_process; /* dst process handle */
  553. unsigned int access; /* wanted access rights */
  554. unsigned int attributes; /* object attributes */
  555. unsigned int options; /* duplicate options */
  556. } dup_handle;
  557. } apc_call_t;
  558. typedef union
  559. {
  560. enum apc_type type;
  561. struct
  562. {
  563. enum apc_type type; /* APC_ASYNC_IO */
  564. unsigned int status; /* new status of async operation */
  565. unsigned int total; /* bytes transferred */
  566. } async_io;
  567. struct
  568. {
  569. enum apc_type type; /* APC_VIRTUAL_ALLOC */
  570. unsigned int status; /* status returned by call */
  571. client_ptr_t addr; /* resulting address */
  572. mem_size_t size; /* resulting size */
  573. } virtual_alloc;
  574. struct
  575. {
  576. enum apc_type type; /* APC_VIRTUAL_FREE */
  577. unsigned int status; /* status returned by call */
  578. client_ptr_t addr; /* resulting address */
  579. mem_size_t size; /* resulting size */
  580. } virtual_free;
  581. struct
  582. {
  583. enum apc_type type; /* APC_VIRTUAL_QUERY */
  584. unsigned int status; /* status returned by call */
  585. client_ptr_t base; /* resulting base address */
  586. client_ptr_t alloc_base;/* resulting allocation base */
  587. mem_size_t size; /* resulting region size */
  588. unsigned short state; /* resulting region state */
  589. unsigned short prot; /* resulting region protection */
  590. unsigned short alloc_prot;/* resulting allocation protection */
  591. unsigned short alloc_type;/* resulting region allocation type */
  592. } virtual_query;
  593. struct
  594. {
  595. enum apc_type type; /* APC_VIRTUAL_PROTECT */
  596. unsigned int status; /* status returned by call */
  597. client_ptr_t addr; /* resulting address */
  598. mem_size_t size; /* resulting size */
  599. unsigned int prot; /* old protection flags */
  600. } virtual_protect;
  601. struct
  602. {
  603. enum apc_type type; /* APC_VIRTUAL_FLUSH */
  604. unsigned int status; /* status returned by call */
  605. client_ptr_t addr; /* resulting address */
  606. mem_size_t size; /* resulting size */
  607. } virtual_flush;
  608. struct
  609. {
  610. enum apc_type type; /* APC_VIRTUAL_LOCK */
  611. unsigned int status; /* status returned by call */
  612. client_ptr_t addr; /* resulting address */
  613. mem_size_t size; /* resulting size */
  614. } virtual_lock;
  615. struct
  616. {
  617. enum apc_type type; /* APC_VIRTUAL_UNLOCK */
  618. unsigned int status; /* status returned by call */
  619. client_ptr_t addr; /* resulting address */
  620. mem_size_t size; /* resulting size */
  621. } virtual_unlock;
  622. struct
  623. {
  624. enum apc_type type; /* APC_MAP_VIEW */
  625. unsigned int status; /* status returned by call */
  626. client_ptr_t addr; /* resulting address */
  627. mem_size_t size; /* resulting size */
  628. } map_view;
  629. struct
  630. {
  631. enum apc_type type; /* APC_UNMAP_VIEW */
  632. unsigned int status; /* status returned by call */
  633. } unmap_view;
  634. struct
  635. {
  636. enum apc_type type; /* APC_CREATE_THREAD */
  637. unsigned int status; /* status returned by call */
  638. process_id_t pid; /* process id */
  639. thread_id_t tid; /* thread id */
  640. client_ptr_t teb; /* thread teb (in process address space) */
  641. obj_handle_t handle; /* handle to new thread */
  642. } create_thread;
  643. struct
  644. {
  645. enum apc_type type; /* APC_DUP_HANDLE */
  646. unsigned int status; /* status returned by call */
  647. obj_handle_t handle; /* duplicated handle in dst process */
  648. } dup_handle;
  649. struct
  650. {
  651. enum apc_type type; /* APC_BREAK_PROCESS */
  652. unsigned int status; /* status returned by call */
  653. } break_process;
  654. } apc_result_t;
  655. enum irp_type
  656. {
  657. IRP_CALL_NONE,
  658. IRP_CALL_CREATE,
  659. IRP_CALL_CLOSE,
  660. IRP_CALL_READ,
  661. IRP_CALL_WRITE,
  662. IRP_CALL_FLUSH,
  663. IRP_CALL_IOCTL,
  664. IRP_CALL_VOLUME,
  665. IRP_CALL_FREE,
  666. IRP_CALL_CANCEL
  667. };
  668. typedef union
  669. {
  670. enum irp_type type; /* irp call type */
  671. struct
  672. {
  673. enum irp_type type; /* IRP_CALL_CREATE */
  674. unsigned int access; /* access rights */
  675. unsigned int sharing; /* sharing flags */
  676. unsigned int options; /* file options */
  677. client_ptr_t device; /* opaque ptr for the device */
  678. obj_handle_t file; /* file handle */
  679. } create;
  680. struct
  681. {
  682. enum irp_type type; /* IRP_CALL_CLOSE */
  683. int __pad;
  684. client_ptr_t file; /* opaque ptr for the file object */
  685. } close;
  686. struct
  687. {
  688. enum irp_type type; /* IRP_CALL_READ */
  689. unsigned int key; /* driver key */
  690. data_size_t out_size; /* needed output size */
  691. int __pad;
  692. client_ptr_t file; /* opaque ptr for the file object */
  693. file_pos_t pos; /* file position */
  694. } read;
  695. struct
  696. {
  697. enum irp_type type; /* IRP_CALL_WRITE */
  698. unsigned int key; /* driver key */
  699. client_ptr_t file; /* opaque ptr for the file object */
  700. file_pos_t pos; /* file position */
  701. } write;
  702. struct
  703. {
  704. enum irp_type type; /* IRP_CALL_FLUSH */
  705. int __pad;
  706. client_ptr_t file; /* opaque ptr for the file object */
  707. } flush;
  708. struct
  709. {
  710. enum irp_type type; /* IRP_CALL_IOCTL */
  711. ioctl_code_t code; /* ioctl code */
  712. data_size_t out_size; /* needed output size */
  713. int __pad;
  714. client_ptr_t file; /* opaque ptr for the file object */
  715. } ioctl;
  716. struct
  717. {
  718. enum irp_type type; /* IRP_CALL_VOLUME */
  719. unsigned int info_class;/* information class */
  720. data_size_t out_size; /* needed output size */
  721. int __pad;
  722. client_ptr_t file; /* opaque ptr for the file object */
  723. } volume;
  724. struct
  725. {
  726. enum irp_type type; /* IRP_CALL_FREE */
  727. int __pad;
  728. client_ptr_t obj; /* opaque ptr for the freed object */
  729. } free;
  730. struct
  731. {
  732. enum irp_type type; /* IRP_CALL_CANCEL */
  733. int __pad;
  734. client_ptr_t irp; /* opaque ptr for canceled irp */
  735. } cancel;
  736. } irp_params_t;
  737. /* information about a PE image mapping, roughly equivalent to SECTION_IMAGE_INFORMATION */
  738. typedef struct
  739. {
  740. client_ptr_t base;
  741. mem_size_t stack_size;
  742. mem_size_t stack_commit;
  743. unsigned int entry_point;
  744. unsigned int map_size;
  745. unsigned int zerobits;
  746. unsigned int subsystem;
  747. unsigned short subsystem_minor;
  748. unsigned short subsystem_major;
  749. unsigned short osversion_major;
  750. unsigned short osversion_minor;
  751. unsigned short image_charact;
  752. unsigned short dll_charact;
  753. unsigned short machine;
  754. unsigned char contains_code;
  755. unsigned char image_flags;
  756. unsigned int loader_flags;
  757. unsigned int header_size;
  758. unsigned int file_size;
  759. unsigned int checksum;
  760. unsigned int dbg_offset;
  761. unsigned int dbg_size;
  762. } pe_image_info_t;
  763. #define IMAGE_FLAGS_ComPlusNativeReady 0x01
  764. #define IMAGE_FLAGS_ComPlusILOnly 0x02
  765. #define IMAGE_FLAGS_ImageDynamicallyRelocated 0x04
  766. #define IMAGE_FLAGS_ImageMappedFlat 0x08
  767. #define IMAGE_FLAGS_BaseBelow4gb 0x10
  768. #define IMAGE_FLAGS_ComPlusPrefer32bit 0x20
  769. #define IMAGE_FLAGS_WineBuiltin 0x40
  770. #define IMAGE_FLAGS_WineFakeDll 0x80
  771. struct rawinput_device
  772. {
  773. unsigned short usage_page;
  774. unsigned short usage;
  775. unsigned int flags;
  776. user_handle_t target;
  777. };
  778. typedef struct
  779. {
  780. int x;
  781. int y;
  782. unsigned int time;
  783. int __pad;
  784. lparam_t info;
  785. } cursor_pos_t;
  786. /****************************************************************/
  787. /* Request declarations */
  788. /* Create a new process from the context of the parent */
  789. @REQ(new_process)
  790. obj_handle_t token; /* process token */
  791. obj_handle_t debug; /* process debug object */
  792. obj_handle_t parent_process; /* parent process */
  793. unsigned int flags; /* process creation flags */
  794. int socket_fd; /* file descriptor for process socket */
  795. unsigned int access; /* access rights for process object */
  796. unsigned short machine; /* architecture that the new process will use */
  797. data_size_t info_size; /* size of startup info */
  798. data_size_t handles_size; /* length of explicit handles list */
  799. data_size_t jobs_size; /* length of jobs list */
  800. VARARG(objattr,object_attributes); /* object attributes */
  801. VARARG(handles,uints,handles_size); /* handles list */
  802. VARARG(jobs,uints,jobs_size); /* jobs list */
  803. VARARG(info,startup_info,info_size); /* startup information */
  804. VARARG(env,unicode_str); /* environment for new process */
  805. @REPLY
  806. obj_handle_t info; /* new process info handle */
  807. process_id_t pid; /* process id */
  808. obj_handle_t handle; /* process handle (in the current process) */
  809. @END
  810. /* Retrieve information about a newly started process */
  811. @REQ(get_new_process_info)
  812. obj_handle_t info; /* info handle returned from new_process_request */
  813. @REPLY
  814. int success; /* did the process start successfully? */
  815. int exit_code; /* process exit code if failed */
  816. @END
  817. /* Create a new thread */
  818. @REQ(new_thread)
  819. obj_handle_t process; /* process in which to create thread */
  820. unsigned int access; /* wanted access rights */
  821. unsigned int flags; /* thread creation flags */
  822. int request_fd; /* fd for request pipe */
  823. VARARG(objattr,object_attributes); /* object attributes */
  824. @REPLY
  825. thread_id_t tid; /* thread id */
  826. obj_handle_t handle; /* thread handle (in the current process) */
  827. @END
  828. /* Retrieve the new process startup info */
  829. @REQ(get_startup_info)
  830. @REPLY
  831. data_size_t info_size; /* size of startup info */
  832. VARARG(info,startup_info,info_size); /* startup information */
  833. VARARG(env,unicode_str); /* environment */
  834. @END
  835. /* Signal the end of the process initialization */
  836. @REQ(init_process_done)
  837. client_ptr_t teb; /* TEB of new thread (in process address space) */
  838. client_ptr_t peb; /* PEB of new process (in process address space) */
  839. client_ptr_t ldt_copy; /* address of LDT copy (in process address space) */
  840. @REPLY
  841. client_ptr_t entry; /* process entry point */
  842. int suspend; /* is process suspended? */
  843. @END
  844. /* Initialize the first thread of a new process */
  845. @REQ(init_first_thread)
  846. int unix_pid; /* Unix pid of new process */
  847. int unix_tid; /* Unix tid of new thread */
  848. int debug_level; /* new debug level */
  849. int reply_fd; /* fd for reply pipe */
  850. int wait_fd; /* fd for blocking calls pipe */
  851. @REPLY
  852. process_id_t pid; /* process id of the new thread's process */
  853. thread_id_t tid; /* thread id of the new thread */
  854. timeout_t server_start; /* server start time */
  855. unsigned int session_id; /* process session id */
  856. data_size_t info_size; /* total size of startup info */
  857. VARARG(machines,ushorts); /* array of supported machines */
  858. @END
  859. /* Initialize a new thread; called from the child after pthread_create() */
  860. @REQ(init_thread)
  861. int unix_tid; /* Unix tid of new thread */
  862. int reply_fd; /* fd for reply pipe */
  863. int wait_fd; /* fd for blocking calls pipe */
  864. client_ptr_t teb; /* TEB of new thread (in thread address space) */
  865. client_ptr_t entry; /* entry point (in thread address space) */
  866. @REPLY
  867. int suspend; /* is thread suspended? */
  868. @END
  869. /* Terminate a process */
  870. @REQ(terminate_process)
  871. obj_handle_t handle; /* process handle to terminate */
  872. int exit_code; /* process exit code */
  873. @REPLY
  874. int self; /* suicide? */
  875. @END
  876. /* Terminate a thread */
  877. @REQ(terminate_thread)
  878. obj_handle_t handle; /* thread handle to terminate */
  879. int exit_code; /* thread exit code */
  880. @REPLY
  881. int self; /* suicide? */
  882. @END
  883. /* Retrieve information about a process */
  884. @REQ(get_process_info)
  885. obj_handle_t handle; /* process handle */
  886. @REPLY
  887. process_id_t pid; /* server process id */
  888. process_id_t ppid; /* server process id of parent */
  889. affinity_t affinity; /* process affinity mask */
  890. client_ptr_t peb; /* PEB address in process address space */
  891. timeout_t start_time; /* process start time */
  892. timeout_t end_time; /* process end time */
  893. unsigned int session_id; /* process session id */
  894. int exit_code; /* process exit code */
  895. int priority; /* priority class */
  896. unsigned short machine; /* process architecture */
  897. VARARG(image,pe_image_info); /* image info for main exe */
  898. @END
  899. /* Retrieve debug information about a process */
  900. @REQ(get_process_debug_info)
  901. obj_handle_t handle; /* process handle */
  902. @REPLY
  903. obj_handle_t debug; /* handle to debug port */
  904. int debug_children; /* inherit debugger to child processes */
  905. VARARG(image,pe_image_info); /* image info for main exe */
  906. @END
  907. /* Fetch the name of the process image */
  908. @REQ(get_process_image_name)
  909. obj_handle_t handle; /* process handle */
  910. int win32; /* return a win32 filename? */
  911. @REPLY
  912. data_size_t len; /* len in bytes required to store filename */
  913. VARARG(name,unicode_str); /* image name for main exe */
  914. @END
  915. /* Retrieve information about a process memory usage */
  916. @REQ(get_process_vm_counters)
  917. obj_handle_t handle; /* process handle */
  918. @REPLY
  919. mem_size_t peak_virtual_size; /* peak virtual memory in bytes */
  920. mem_size_t virtual_size; /* virtual memory in bytes */
  921. mem_size_t peak_working_set_size; /* peak real memory in bytes */
  922. mem_size_t working_set_size; /* real memory in bytes */
  923. mem_size_t pagefile_usage; /* commit charge in bytes */
  924. mem_size_t peak_pagefile_usage; /* peak commit charge in bytes */
  925. @END
  926. /* Set a process information */
  927. @REQ(set_process_info)
  928. obj_handle_t handle; /* process handle */
  929. int mask; /* setting mask (see below) */
  930. int priority; /* priority class */
  931. affinity_t affinity; /* affinity mask */
  932. @END
  933. #define SET_PROCESS_INFO_PRIORITY 0x01
  934. #define SET_PROCESS_INFO_AFFINITY 0x02
  935. /* Retrieve information about a thread */
  936. @REQ(get_thread_info)
  937. obj_handle_t handle; /* thread handle */
  938. unsigned int access; /* required access rights */
  939. @REPLY
  940. process_id_t pid; /* server process id */
  941. thread_id_t tid; /* server thread id */
  942. client_ptr_t teb; /* thread teb pointer */
  943. client_ptr_t entry_point; /* thread entry point */
  944. affinity_t affinity; /* thread affinity mask */
  945. int exit_code; /* thread exit code */
  946. int priority; /* thread priority level */
  947. int last; /* last thread in process */
  948. int suspend_count; /* thread suspend count */
  949. int dbg_hidden; /* thread hidden from debugger */
  950. data_size_t desc_len; /* description length in bytes */
  951. VARARG(desc,unicode_str); /* description string */
  952. @END
  953. /* Retrieve information about thread times */
  954. @REQ(get_thread_times)
  955. obj_handle_t handle; /* thread handle */
  956. @REPLY
  957. timeout_t creation_time; /* thread creation time */
  958. timeout_t exit_time; /* thread exit time */
  959. int unix_pid; /* thread native pid */
  960. int unix_tid; /* thread native pid */
  961. @END
  962. /* Set a thread information */
  963. @REQ(set_thread_info)
  964. obj_handle_t handle; /* thread handle */
  965. int mask; /* setting mask (see below) */
  966. int priority; /* priority class */
  967. affinity_t affinity; /* affinity mask */
  968. client_ptr_t entry_point; /* thread entry point */
  969. obj_handle_t token; /* impersonation token */
  970. VARARG(desc,unicode_str); /* description string */
  971. @END
  972. #define SET_THREAD_INFO_PRIORITY 0x01
  973. #define SET_THREAD_INFO_AFFINITY 0x02
  974. #define SET_THREAD_INFO_TOKEN 0x04
  975. #define SET_THREAD_INFO_ENTRYPOINT 0x08
  976. #define SET_THREAD_INFO_DESCRIPTION 0x10
  977. #define SET_THREAD_INFO_DBG_HIDDEN 0x20
  978. /* Suspend a thread */
  979. @REQ(suspend_thread)
  980. obj_handle_t handle; /* thread handle */
  981. @REPLY
  982. int count; /* new suspend count */
  983. @END
  984. /* Resume a thread */
  985. @REQ(resume_thread)
  986. obj_handle_t handle; /* thread handle */
  987. @REPLY
  988. int count; /* new suspend count */
  989. @END
  990. /* Queue an APC for a thread or process */
  991. @REQ(queue_apc)
  992. obj_handle_t handle; /* thread or process handle */
  993. apc_call_t call; /* call arguments */
  994. @REPLY
  995. obj_handle_t handle; /* APC handle */
  996. int self; /* run APC in caller itself? */
  997. @END
  998. /* Get the result of an APC call */
  999. @REQ(get_apc_result)
  1000. obj_handle_t handle; /* handle to the APC */
  1001. @REPLY
  1002. apc_result_t result; /* result of the APC */
  1003. @END
  1004. /* Close a handle for the current process */
  1005. @REQ(close_handle)
  1006. obj_handle_t handle; /* handle to close */
  1007. @END
  1008. /* Set a handle information */
  1009. @REQ(set_handle_info)
  1010. obj_handle_t handle; /* handle we are interested in */
  1011. int flags; /* new handle flags */
  1012. int mask; /* mask for flags to set */
  1013. @REPLY
  1014. int old_flags; /* old flag value */
  1015. @END
  1016. /* Duplicate a handle */
  1017. @REQ(dup_handle)
  1018. obj_handle_t src_process; /* src process handle */
  1019. obj_handle_t src_handle; /* src handle to duplicate */
  1020. obj_handle_t dst_process; /* dst process handle */
  1021. unsigned int access; /* wanted access rights */
  1022. unsigned int attributes; /* object attributes */
  1023. unsigned int options; /* duplicate options */
  1024. @REPLY
  1025. obj_handle_t handle; /* duplicated handle in dst process */
  1026. @END
  1027. /* Test if two handles refer to the same object */
  1028. @REQ(compare_objects)
  1029. obj_handle_t first; /* first object handle */
  1030. obj_handle_t second; /* second object handle */
  1031. @END
  1032. /* Make an object temporary */
  1033. @REQ(make_temporary)
  1034. obj_handle_t handle; /* handle to the object */
  1035. @END
  1036. /* Open a handle to a process */
  1037. @REQ(open_process)
  1038. process_id_t pid; /* process id to open */
  1039. unsigned int access; /* wanted access rights */
  1040. unsigned int attributes; /* object attributes */
  1041. @REPLY
  1042. obj_handle_t handle; /* handle to the process */
  1043. @END
  1044. /* Open a handle to a thread */
  1045. @REQ(open_thread)
  1046. thread_id_t tid; /* thread id to open */
  1047. unsigned int access; /* wanted access rights */
  1048. unsigned int attributes; /* object attributes */
  1049. @REPLY
  1050. obj_handle_t handle; /* handle to the thread */
  1051. @END
  1052. /* Wait for handles */
  1053. @REQ(select)
  1054. int flags; /* wait flags (see below) */
  1055. client_ptr_t cookie; /* magic cookie to return to client */
  1056. abstime_t timeout; /* timeout */
  1057. data_size_t size; /* size of select_op */
  1058. obj_handle_t prev_apc; /* handle to previous APC */
  1059. VARARG(result,apc_result); /* result of previous APC */
  1060. VARARG(data,select_op,size); /* operation-specific data */
  1061. VARARG(contexts,contexts); /* suspend context(s) */
  1062. @REPLY
  1063. apc_call_t call; /* APC call arguments */
  1064. obj_handle_t apc_handle; /* handle to next APC */
  1065. int signaled; /* were the handles immediately signaled? */
  1066. VARARG(contexts,contexts); /* suspend context(s) */
  1067. @END
  1068. #define SELECT_ALERTABLE 1
  1069. #define SELECT_INTERRUPTIBLE 2
  1070. /* Create an event */
  1071. @REQ(create_event)
  1072. unsigned int access; /* wanted access rights */
  1073. int manual_reset; /* manual reset event */
  1074. int initial_state; /* initial state of the event */
  1075. VARARG(objattr,object_attributes); /* object attributes */
  1076. @REPLY
  1077. obj_handle_t handle; /* handle to the event */
  1078. @END
  1079. /* Event operation */
  1080. @REQ(event_op)
  1081. obj_handle_t handle; /* handle to event */
  1082. int op; /* event operation (see below) */
  1083. @REPLY
  1084. int state; /* previous state */
  1085. @END
  1086. enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
  1087. @REQ(query_event)
  1088. obj_handle_t handle; /* handle to event */
  1089. @REPLY
  1090. int manual_reset; /* manual reset event */
  1091. int state; /* current state of the event */
  1092. @END
  1093. /* Open an event */
  1094. @REQ(open_event)
  1095. unsigned int access; /* wanted access rights */
  1096. unsigned int attributes; /* object attributes */
  1097. obj_handle_t rootdir; /* root directory */
  1098. VARARG(name,unicode_str); /* object name */
  1099. @REPLY
  1100. obj_handle_t handle; /* handle to the event */
  1101. @END
  1102. /* Create a keyed event */
  1103. @REQ(create_keyed_event)
  1104. unsigned int access; /* wanted access rights */
  1105. VARARG(objattr,object_attributes); /* object attributes */
  1106. @REPLY
  1107. obj_handle_t handle; /* handle to the event */
  1108. @END
  1109. /* Open a keyed event */
  1110. @REQ(open_keyed_event)
  1111. unsigned int access; /* wanted access rights */
  1112. unsigned int attributes; /* object attributes */
  1113. obj_handle_t rootdir; /* root directory */
  1114. VARARG(name,unicode_str); /* object name */
  1115. @REPLY
  1116. obj_handle_t handle; /* handle to the event */
  1117. @END
  1118. /* Create a mutex */
  1119. @REQ(create_mutex)
  1120. unsigned int access; /* wanted access rights */
  1121. int owned; /* initially owned? */
  1122. VARARG(objattr,object_attributes); /* object attributes */
  1123. @REPLY
  1124. obj_handle_t handle; /* handle to the mutex */
  1125. @END
  1126. /* Release a mutex */
  1127. @REQ(release_mutex)
  1128. obj_handle_t handle; /* handle to the mutex */
  1129. @REPLY
  1130. unsigned int prev_count; /* value of internal counter, before release */
  1131. @END
  1132. /* Open a mutex */
  1133. @REQ(open_mutex)
  1134. unsigned int access; /* wanted access rights */
  1135. unsigned int attributes; /* object attributes */
  1136. obj_handle_t rootdir; /* root directory */
  1137. VARARG(name,unicode_str); /* object name */
  1138. @REPLY
  1139. obj_handle_t handle; /* handle to the mutex */
  1140. @END
  1141. /* Query a mutex */
  1142. @REQ(query_mutex)
  1143. obj_handle_t handle; /* handle to mutex */
  1144. @REPLY
  1145. unsigned int count; /* current count of mutex */
  1146. int owned; /* true if owned by current thread */
  1147. int abandoned; /* true if abandoned */
  1148. @END
  1149. /* Create a semaphore */
  1150. @REQ(create_semaphore)
  1151. unsigned int access; /* wanted access rights */
  1152. unsigned int initial; /* initial count */
  1153. unsigned int max; /* maximum count */
  1154. VARARG(objattr,object_attributes); /* object attributes */
  1155. @REPLY
  1156. obj_handle_t handle; /* handle to the semaphore */
  1157. @END
  1158. /* Release a semaphore */
  1159. @REQ(release_semaphore)
  1160. obj_handle_t handle; /* handle to the semaphore */
  1161. unsigned int count; /* count to add to semaphore */
  1162. @REPLY
  1163. unsigned int prev_count; /* previous semaphore count */
  1164. @END
  1165. @REQ(query_semaphore)
  1166. obj_handle_t handle; /* handle to the semaphore */
  1167. @REPLY
  1168. unsigned int current; /* current count */
  1169. unsigned int max; /* maximum count */
  1170. @END
  1171. /* Open a semaphore */
  1172. @REQ(open_semaphore)
  1173. unsigned int access; /* wanted access rights */
  1174. unsigned int attributes; /* object attributes */
  1175. obj_handle_t rootdir; /* root directory */
  1176. VARARG(name,unicode_str); /* object name */
  1177. @REPLY
  1178. obj_handle_t handle; /* handle to the semaphore */
  1179. @END
  1180. /* Create a file */
  1181. @REQ(create_file)
  1182. unsigned int access; /* wanted access rights */
  1183. unsigned int sharing; /* sharing flags */
  1184. int create; /* file create action */
  1185. unsigned int options; /* file options */
  1186. unsigned int attrs; /* file attributes for creation */
  1187. VARARG(objattr,object_attributes); /* object attributes */
  1188. VARARG(filename,string); /* file name */
  1189. @REPLY
  1190. obj_handle_t handle; /* handle to the file */
  1191. @END
  1192. /* Open a file object */
  1193. @REQ(open_file_object)
  1194. unsigned int access; /* wanted access rights */
  1195. unsigned int attributes; /* open attributes */
  1196. obj_handle_t rootdir; /* root directory */
  1197. unsigned int sharing; /* sharing flags */
  1198. unsigned int options; /* file options */
  1199. VARARG(filename,unicode_str); /* file name */
  1200. @REPLY
  1201. obj_handle_t handle; /* handle to the file */
  1202. @END
  1203. /* Allocate a file handle for a Unix fd */
  1204. @REQ(alloc_file_handle)
  1205. unsigned int access; /* wanted access rights */
  1206. unsigned int attributes; /* object attributes */
  1207. int fd; /* file descriptor on the client side */
  1208. @REPLY
  1209. obj_handle_t handle; /* handle to the file */
  1210. @END
  1211. /* Get the Unix name from a file handle */
  1212. @REQ(get_handle_unix_name)
  1213. obj_handle_t handle; /* file handle */
  1214. @REPLY
  1215. data_size_t name_len; /* unix name length */
  1216. VARARG(name,string); /* unix name */
  1217. @END
  1218. /* Get a Unix fd to access a file */
  1219. @REQ(get_handle_fd)
  1220. obj_handle_t handle; /* handle to the file */
  1221. @REPLY
  1222. int type; /* file type (see below) */
  1223. int cacheable; /* can fd be cached in the client? */
  1224. unsigned int access; /* file access rights */
  1225. unsigned int options; /* file open options */
  1226. @END
  1227. enum server_fd_type
  1228. {
  1229. FD_TYPE_INVALID, /* invalid file (no associated fd) */
  1230. FD_TYPE_FILE, /* regular file */
  1231. FD_TYPE_DIR, /* directory */
  1232. FD_TYPE_SOCKET, /* socket */
  1233. FD_TYPE_SERIAL, /* serial port */
  1234. FD_TYPE_PIPE, /* named pipe */
  1235. FD_TYPE_MAILSLOT, /* mailslot */
  1236. FD_TYPE_CHAR, /* unspecified char device */
  1237. FD_TYPE_DEVICE, /* Windows device file */
  1238. FD_TYPE_NB_TYPES
  1239. };
  1240. /* Retrieve (or allocate) the client-side directory cache entry */
  1241. @REQ(get_directory_cache_entry)
  1242. obj_handle_t handle; /* handle to the directory */
  1243. @REPLY
  1244. int entry; /* cache entry on the client side */
  1245. VARARG(free,ints); /* entries that can be freed */
  1246. @END
  1247. /* Flush a file buffers */
  1248. @REQ(flush)
  1249. async_data_t async; /* async I/O parameters */
  1250. @REPLY
  1251. obj_handle_t event; /* event set when finished */
  1252. @END
  1253. /* Query file information */
  1254. @REQ(get_file_info)
  1255. obj_handle_t handle; /* handle to the file */
  1256. unsigned int info_class; /* queried information class */
  1257. @REPLY
  1258. VARARG(data,bytes); /* file info data */
  1259. @END
  1260. /* Query volume information */
  1261. @REQ(get_volume_info)
  1262. obj_handle_t handle; /* handle to the file */
  1263. async_data_t async; /* async I/O parameters */
  1264. unsigned int info_class; /* queried information class */
  1265. @REPLY
  1266. obj_handle_t wait; /* handle to wait on for blocking read */
  1267. VARARG(data,bytes); /* volume info data */
  1268. @END
  1269. /* Lock a region of a file */
  1270. @REQ(lock_file)
  1271. obj_handle_t handle; /* handle to the file */
  1272. file_pos_t offset; /* offset of start of lock */
  1273. file_pos_t count; /* count of bytes to lock */
  1274. int shared; /* shared or exclusive lock? */
  1275. int wait; /* do we want to wait? */
  1276. @REPLY
  1277. obj_handle_t handle; /* handle to wait on */
  1278. int overlapped; /* is it an overlapped I/O handle? */
  1279. @END
  1280. /* Unlock a region of a file */
  1281. @REQ(unlock_file)
  1282. obj_handle_t handle; /* handle to the file */
  1283. file_pos_t offset; /* offset of start of unlock */
  1284. file_pos_t count; /* count of bytes to unlock */
  1285. @END
  1286. /* Perform a recv on a socket */
  1287. @REQ(recv_socket)
  1288. int oob; /* are we receiving OOB data? */
  1289. async_data_t async; /* async I/O parameters */
  1290. unsigned int status; /* status of initial call */
  1291. unsigned int total; /* number of bytes already read */
  1292. @REPLY
  1293. obj_handle_t wait; /* handle to wait on for blocking recv */
  1294. unsigned int options; /* device open options */
  1295. @END
  1296. /* Perform a send on a socket */
  1297. @REQ(send_socket)
  1298. async_data_t async; /* async I/O parameters */
  1299. unsigned int status; /* status of initial call */
  1300. unsigned int total; /* number of bytes already sent */
  1301. @REPLY
  1302. obj_handle_t wait; /* handle to wait on for blocking send */
  1303. unsigned int options; /* device open options */
  1304. @END
  1305. /* Retrieve the next pending console ioctl request */
  1306. @REQ(get_next_console_request)
  1307. obj_handle_t handle; /* console server handle */
  1308. int signal; /* server signal state */
  1309. int read; /* 1 if reporting result of blocked read ioctl */
  1310. unsigned int status; /* status of previous ioctl */
  1311. VARARG(out_data,bytes); /* out_data of previous ioctl */
  1312. @REPLY
  1313. unsigned int code; /* ioctl code */
  1314. unsigned int output; /* output id or 0 for input */
  1315. data_size_t out_size; /* ioctl output size */
  1316. VARARG(in_data,bytes); /* ioctl in_data */
  1317. @END
  1318. /* enable directory change notifications */
  1319. @REQ(read_directory_changes)
  1320. unsigned int filter; /* notification filter */
  1321. int subtree; /* watch the subtree? */
  1322. int want_data; /* flag indicating whether change data should be collected */
  1323. async_data_t async; /* async I/O parameters */
  1324. @END
  1325. @REQ(read_change)
  1326. obj_handle_t handle;
  1327. @REPLY
  1328. VARARG(events,filesystem_event); /* collected filesystem events */
  1329. @END
  1330. /* Create a file mapping */
  1331. @REQ(create_mapping)
  1332. unsigned int access; /* wanted access rights */
  1333. unsigned int flags; /* SEC_* flags */
  1334. unsigned int file_access; /* file access rights */
  1335. mem_size_t size; /* mapping size */
  1336. obj_handle_t file_handle; /* file handle */
  1337. VARARG(objattr,object_attributes); /* object attributes */
  1338. @REPLY
  1339. obj_handle_t handle; /* handle to the mapping */
  1340. @END
  1341. /* Open a mapping */
  1342. @REQ(open_mapping)
  1343. unsigned int access; /* wanted access rights */
  1344. unsigned int attributes; /* object attributes */
  1345. obj_handle_t rootdir; /* root directory */
  1346. VARARG(name,unicode_str); /* object name */
  1347. @REPLY
  1348. obj_handle_t handle; /* handle to the mapping */
  1349. @END
  1350. /* Get information about a file mapping */
  1351. @REQ(get_mapping_info)
  1352. obj_handle_t handle; /* handle to the mapping */
  1353. unsigned int access; /* wanted access rights */
  1354. @REPLY
  1355. mem_size_t size; /* mapping size */
  1356. unsigned int flags; /* SEC_* flags */
  1357. obj_handle_t shared_file; /* shared mapping file handle */
  1358. data_size_t total; /* total required buffer size in bytes */
  1359. VARARG(image,pe_image_info);/* image info for SEC_IMAGE mappings */
  1360. VARARG(name,unicode_str); /* filename for SEC_IMAGE mappings */
  1361. @END
  1362. /* Add a memory view in the current process */
  1363. @REQ(map_view)
  1364. obj_handle_t mapping; /* file mapping handle, or 0 for .so builtin */
  1365. unsigned int access; /* wanted access rights */
  1366. client_ptr_t base; /* view base address (page-aligned) */
  1367. mem_size_t size; /* view size */
  1368. file_pos_t start; /* start offset in mapping */
  1369. VARARG(image,pe_image_info);/* image info for .so builtins */
  1370. VARARG(name,unicode_str); /* image filename for .so builtins */
  1371. @END
  1372. /* Unmap a memory view from the current process */
  1373. @REQ(unmap_view)
  1374. client_ptr_t base; /* view base address */
  1375. @END
  1376. /* Get a range of committed pages in a file mapping */
  1377. @REQ(get_mapping_committed_range)
  1378. client_ptr_t base; /* view base address */
  1379. file_pos_t offset; /* starting offset (page-aligned, in bytes) */
  1380. @REPLY
  1381. mem_size_t size; /* size of range starting at offset (page-aligned, in bytes) */
  1382. int committed; /* whether it is a committed range */
  1383. @END
  1384. /* Add a range to the committed pages in a file mapping */
  1385. @REQ(add_mapping_committed_range)
  1386. client_ptr_t base; /* view base address */
  1387. file_pos_t offset; /* starting offset (page-aligned, in bytes) */
  1388. mem_size_t size; /* size to set (page-aligned, in bytes) or 0 if only retrieving */
  1389. @END
  1390. /* Check if two memory maps are for the same file */
  1391. @REQ(is_same_mapping)
  1392. client_ptr_t base1; /* first view base address */
  1393. client_ptr_t base2; /* second view base address */
  1394. @END
  1395. /* Get the filename of a mapping */
  1396. @REQ(get_mapping_filename)
  1397. obj_handle_t process; /* process handle */
  1398. client_ptr_t addr; /* address inside mapped view (in process address space) */
  1399. @REPLY
  1400. data_size_t len; /* total filename length in bytes */
  1401. VARARG(filename,unicode_str); /* filename in NT format */
  1402. @END
  1403. struct thread_info
  1404. {
  1405. timeout_t start_time;
  1406. thread_id_t tid;
  1407. int base_priority;
  1408. int current_priority;
  1409. int unix_tid;
  1410. client_ptr_t teb;
  1411. client_ptr_t entry_point;
  1412. };
  1413. struct process_info
  1414. {
  1415. timeout_t start_time;
  1416. data_size_t name_len;
  1417. int thread_count;
  1418. int priority;
  1419. process_id_t pid;
  1420. process_id_t parent_pid;
  1421. unsigned int session_id;
  1422. int handle_count;
  1423. int unix_pid;
  1424. /* VARARG(name,unicode_str,name_len); */
  1425. /* VARARG(threads,struct thread_info,thread_count); */
  1426. };
  1427. /* Get a list of processes and threads currently running */
  1428. @REQ(list_processes)
  1429. @REPLY
  1430. data_size_t info_size;
  1431. int process_count;
  1432. int total_thread_count;
  1433. data_size_t total_name_len;
  1434. VARARG(data,process_info,info_size);
  1435. @END
  1436. /* Create a debug object */
  1437. @REQ(create_debug_obj)
  1438. unsigned int access; /* wanted access rights */
  1439. unsigned int flags; /* object flags */
  1440. VARARG(objattr,object_attributes); /* object attributes */
  1441. @REPLY
  1442. obj_handle_t handle; /* handle to the debug object */
  1443. @END
  1444. /* Wait for a debug event */
  1445. @REQ(wait_debug_event)
  1446. obj_handle_t debug; /* debug object */
  1447. @REPLY
  1448. process_id_t pid; /* process id */
  1449. thread_id_t tid; /* thread id */
  1450. VARARG(event,debug_event); /* debug event data */
  1451. @END
  1452. /* Queue an exception event */
  1453. @REQ(queue_exception_event)
  1454. int first; /* first chance exception? */
  1455. unsigned int code; /* exception code */
  1456. unsigned int flags; /* exception flags */
  1457. client_ptr_t record; /* exception record */
  1458. client_ptr_t address; /* exception address */
  1459. data_size_t len; /* size of parameters */
  1460. VARARG(params,uints64,len);/* exception parameters */
  1461. @REPLY
  1462. obj_handle_t handle; /* handle to the queued event */
  1463. @END
  1464. /* Retrieve the status of an exception event */
  1465. @REQ(get_exception_status)
  1466. obj_handle_t handle; /* handle to the queued event */
  1467. @END
  1468. /* Continue a debug event */
  1469. @REQ(continue_debug_event)
  1470. obj_handle_t debug; /* debug object */
  1471. process_id_t pid; /* process id to continue */
  1472. thread_id_t tid; /* thread id to continue */
  1473. unsigned int status; /* continuation status */
  1474. @END
  1475. /* Start or stop debugging an existing process */
  1476. @REQ(debug_process)
  1477. obj_handle_t handle; /* process handle */
  1478. obj_handle_t debug; /* debug object to attach to the process */
  1479. int attach; /* 1=attaching / 0=detaching from the process */
  1480. @END
  1481. /* Set debug object information */
  1482. @REQ(set_debug_obj_info)
  1483. obj_handle_t debug; /* debug object */
  1484. unsigned int flags; /* object flags */
  1485. @END
  1486. /* Read data from a process address space */
  1487. @REQ(read_process_memory)
  1488. obj_handle_t handle; /* process handle */
  1489. client_ptr_t addr; /* addr to read from */
  1490. @REPLY
  1491. VARARG(data,bytes); /* result data */
  1492. @END
  1493. /* Write data to a process address space */
  1494. @REQ(write_process_memory)
  1495. obj_handle_t handle; /* process handle */
  1496. client_ptr_t addr; /* addr to write to */
  1497. VARARG(data,bytes); /* data to write */
  1498. @END
  1499. /* Create a registry key */
  1500. @REQ(create_key)
  1501. unsigned int access; /* desired access rights */
  1502. unsigned int options; /* creation options */
  1503. VARARG(objattr,object_attributes); /* object attributes */
  1504. VARARG(class,unicode_str); /* class name */
  1505. @REPLY
  1506. obj_handle_t hkey; /* handle to the created key */
  1507. int created; /* has it been newly created? */
  1508. @END
  1509. /* Open a registry key */
  1510. @REQ(open_key)
  1511. obj_handle_t parent; /* handle to the parent key */
  1512. unsigned int access; /* desired access rights */
  1513. unsigned int attributes; /* object attributes */
  1514. VARARG(name,unicode_str); /* key name */
  1515. @REPLY
  1516. obj_handle_t hkey; /* handle to the open key */
  1517. @END
  1518. /* Delete a registry key */
  1519. @REQ(delete_key)
  1520. obj_handle_t hkey; /* handle to the key */
  1521. @END
  1522. /* Flush a registry key */
  1523. @REQ(flush_key)
  1524. obj_handle_t hkey; /* handle to the key */
  1525. @END
  1526. /* Enumerate registry subkeys */
  1527. @REQ(enum_key)
  1528. obj_handle_t hkey; /* handle to registry key */
  1529. int index; /* index of subkey (or -1 for current key) */
  1530. int info_class; /* requested information class */
  1531. @REPLY
  1532. int subkeys; /* number of subkeys */
  1533. int max_subkey; /* longest subkey name */
  1534. int max_class; /* longest class name */
  1535. int values; /* number of values */
  1536. int max_value; /* longest value name */
  1537. int max_data; /* longest value data */
  1538. timeout_t modif; /* last modification time */
  1539. data_size_t total; /* total length needed for full name and class */
  1540. data_size_t namelen; /* length of key name in bytes */
  1541. VARARG(name,unicode_str,namelen); /* key name */
  1542. VARARG(class,unicode_str); /* class name */
  1543. @END
  1544. /* Set a value of a registry key */
  1545. @REQ(set_key_value)
  1546. obj_handle_t hkey; /* handle to registry key */
  1547. int type; /* value type */
  1548. data_size_t namelen; /* length of value name in bytes */
  1549. VARARG(name,unicode_str,namelen); /* value name */
  1550. VARARG(data,bytes); /* value data */
  1551. @END
  1552. /* Retrieve the value of a registry key */
  1553. @REQ(get_key_value)
  1554. obj_handle_t hkey; /* handle to registry key */
  1555. VARARG(name,unicode_str); /* value name */
  1556. @REPLY
  1557. int type; /* value type */
  1558. data_size_t total; /* total length needed for data */
  1559. VARARG(data,bytes); /* value data */
  1560. @END
  1561. /* Enumerate a value of a registry key */
  1562. @REQ(enum_key_value)
  1563. obj_handle_t hkey; /* handle to registry key */
  1564. int index; /* value index */
  1565. int info_class; /* requested information class */
  1566. @REPLY
  1567. int type; /* value type */
  1568. data_size_t total; /* total length needed for full name and data */
  1569. data_size_t namelen; /* length of value name in bytes */
  1570. VARARG(name,unicode_str,namelen); /* value name */
  1571. VARARG(data,bytes); /* value data */
  1572. @END
  1573. /* Delete a value of a registry key */
  1574. @REQ(delete_key_value)
  1575. obj_handle_t hkey; /* handle to registry key */
  1576. VARARG(name,unicode_str); /* value name */
  1577. @END
  1578. /* Load a registry branch from a file */
  1579. @REQ(load_registry)
  1580. obj_handle_t file; /* file to load from */
  1581. VARARG(objattr,object_attributes); /* object attributes */
  1582. @END
  1583. /* UnLoad a registry branch from a file */
  1584. @REQ(unload_registry)
  1585. obj_handle_t parent; /* handle to the parent key */
  1586. unsigned int attributes; /* object attributes */
  1587. VARARG(name,unicode_str); /* key name */
  1588. @END
  1589. /* Save a registry branch to a file */
  1590. @REQ(save_registry)
  1591. obj_handle_t hkey; /* key to save */
  1592. obj_handle_t file; /* file to save to */
  1593. @END
  1594. /* Add a registry key change notification */
  1595. @REQ(set_registry_notification)
  1596. obj_handle_t hkey; /* key to watch for changes */
  1597. obj_handle_t event; /* event to set */
  1598. int subtree; /* should we watch the whole subtree? */
  1599. unsigned int filter; /* things to watch */
  1600. @END
  1601. /* Create a waitable timer */
  1602. @REQ(create_timer)
  1603. unsigned int access; /* wanted access rights */
  1604. int manual; /* manual reset */
  1605. VARARG(objattr,object_attributes); /* object attributes */
  1606. @REPLY
  1607. obj_handle_t handle; /* handle to the timer */
  1608. @END
  1609. /* Open a waitable timer */
  1610. @REQ(open_timer)
  1611. unsigned int access; /* wanted access rights */
  1612. unsigned int attributes; /* object attributes */
  1613. obj_handle_t rootdir; /* root directory */
  1614. VARARG(name,unicode_str); /* object name */
  1615. @REPLY
  1616. obj_handle_t handle; /* handle to the timer */
  1617. @END
  1618. /* Set a waitable timer */
  1619. @REQ(set_timer)
  1620. obj_handle_t handle; /* handle to the timer */
  1621. timeout_t expire; /* next expiration absolute time */
  1622. client_ptr_t callback; /* callback function */
  1623. client_ptr_t arg; /* callback argument */
  1624. int period; /* timer period in ms */
  1625. @REPLY
  1626. int signaled; /* was the timer signaled before this call ? */
  1627. @END
  1628. /* Cancel a waitable timer */
  1629. @REQ(cancel_timer)
  1630. obj_handle_t handle; /* handle to the timer */
  1631. @REPLY
  1632. int signaled; /* was the timer signaled before this calltime ? */
  1633. @END
  1634. /* Get information on a waitable timer */
  1635. @REQ(get_timer_info)
  1636. obj_handle_t handle; /* handle to the timer */
  1637. @REPLY
  1638. timeout_t when; /* absolute time when the timer next expires */
  1639. int signaled; /* is the timer signaled? */
  1640. @END
  1641. /* Retrieve the current context of a thread */
  1642. @REQ(get_thread_context)
  1643. obj_handle_t handle; /* thread handle */
  1644. obj_handle_t context; /* context handle */
  1645. unsigned int flags; /* context flags */
  1646. unsigned short machine; /* context architecture */
  1647. @REPLY
  1648. int self; /* was it a handle to the current thread? */
  1649. obj_handle_t handle; /* pending context handle */
  1650. VARARG(contexts,contexts); /* thread context(s) */
  1651. @END
  1652. /* Set the current context of a thread */
  1653. @REQ(set_thread_context)
  1654. obj_handle_t handle; /* thread handle */
  1655. VARARG(contexts,contexts); /* thread context(s) */
  1656. @REPLY
  1657. int self; /* was it a handle to the current thread? */
  1658. @END
  1659. /* Fetch a selector entry for a thread */
  1660. @REQ(get_selector_entry)
  1661. obj_handle_t handle; /* thread handle */
  1662. int entry; /* LDT entry */
  1663. @REPLY
  1664. unsigned int base; /* selector base */
  1665. unsigned int limit; /* selector limit */
  1666. unsigned char flags; /* selector flags */
  1667. @END
  1668. /* Add an atom */
  1669. @REQ(add_atom)
  1670. VARARG(name,unicode_str); /* atom name */
  1671. @REPLY
  1672. atom_t atom; /* resulting atom */
  1673. @END
  1674. /* Delete an atom */
  1675. @REQ(delete_atom)
  1676. atom_t atom; /* atom handle */
  1677. @END
  1678. /* Find an atom */
  1679. @REQ(find_atom)
  1680. VARARG(name,unicode_str); /* atom name */
  1681. @REPLY
  1682. atom_t atom; /* atom handle */
  1683. @END
  1684. /* Get information about an atom */
  1685. @REQ(get_atom_information)
  1686. atom_t atom; /* atom handle */
  1687. @REPLY
  1688. int count; /* atom lock count */
  1689. int pinned; /* whether the atom has been pinned */
  1690. data_size_t total; /* actual length of atom name */
  1691. VARARG(name,unicode_str); /* atom name */
  1692. @END
  1693. /* Get the message queue of the current thread */
  1694. @REQ(get_msg_queue)
  1695. @REPLY
  1696. obj_handle_t handle; /* handle to the queue */
  1697. @END
  1698. /* Set the file descriptor associated to the current thread queue */
  1699. @REQ(set_queue_fd)
  1700. obj_handle_t handle; /* handle to the file descriptor */
  1701. @END
  1702. /* Set the current message queue wakeup mask */
  1703. @REQ(set_queue_mask)
  1704. unsigned int wake_mask; /* wakeup bits mask */
  1705. unsigned int changed_mask; /* changed bits mask */
  1706. int skip_wait; /* will we skip waiting if signaled? */
  1707. @REPLY
  1708. unsigned int wake_bits; /* current wake bits */
  1709. unsigned int changed_bits; /* current changed bits */
  1710. @END
  1711. /* Get the current message queue status */
  1712. @REQ(get_queue_status)
  1713. unsigned int clear_bits; /* should we clear the change bits? */
  1714. @REPLY
  1715. unsigned int wake_bits; /* wake bits */
  1716. unsigned int changed_bits; /* changed bits since last time */
  1717. @END
  1718. /* Retrieve the process idle event */
  1719. @REQ(get_process_idle_event)
  1720. obj_handle_t handle; /* process handle */
  1721. @REPLY
  1722. obj_handle_t event; /* handle to idle event */
  1723. @END
  1724. /* Send a message to a thread queue */
  1725. @REQ(send_message)
  1726. thread_id_t id; /* thread id */
  1727. int type; /* message type (see below) */
  1728. int flags; /* message flags (see below) */
  1729. user_handle_t win; /* window handle */
  1730. unsigned int msg; /* message code */
  1731. lparam_t wparam; /* parameters */
  1732. lparam_t lparam; /* parameters */
  1733. timeout_t timeout; /* timeout for reply */
  1734. VARARG(data,message_data); /* message data for sent messages */
  1735. @END
  1736. @REQ(post_quit_message)
  1737. int exit_code; /* exit code to return */
  1738. @END
  1739. enum message_type
  1740. {
  1741. MSG_ASCII, /* Ascii message (from SendMessageA) */
  1742. MSG_UNICODE, /* Unicode message (from SendMessageW) */
  1743. MSG_NOTIFY, /* notify message (from SendNotifyMessageW), always Unicode */
  1744. MSG_CALLBACK, /* callback message (from SendMessageCallbackW), always Unicode */
  1745. MSG_CALLBACK_RESULT,/* result of a callback message */
  1746. MSG_OTHER_PROCESS, /* sent from other process, may include vararg data, always Unicode */
  1747. MSG_POSTED, /* posted message (from PostMessageW), always Unicode */
  1748. MSG_HARDWARE, /* hardware message */
  1749. MSG_WINEVENT, /* winevent message */
  1750. MSG_HOOK_LL /* low-level hardware hook */
  1751. };
  1752. #define SEND_MSG_ABORT_IF_HUNG 0x01
  1753. /* Send a hardware message to a thread queue */
  1754. @REQ(send_hardware_message)
  1755. user_handle_t win; /* window handle */
  1756. hw_input_t input; /* input data */
  1757. unsigned int flags; /* flags (see below) */
  1758. VARARG(report,bytes); /* HID report data */
  1759. @REPLY
  1760. int wait; /* do we need to wait for a reply? */
  1761. int prev_x; /* previous cursor position */
  1762. int prev_y;
  1763. int new_x; /* new cursor position */
  1764. int new_y;
  1765. VARARG(keystate,bytes); /* global state array for all the keys */
  1766. @END
  1767. #define SEND_HWMSG_INJECTED 0x01
  1768. /* Get a message from the current queue */
  1769. @REQ(get_message)
  1770. unsigned int flags; /* PM_* flags */
  1771. user_handle_t get_win; /* window handle to get */
  1772. unsigned int get_first; /* first message code to get */
  1773. unsigned int get_last; /* last message code to get */
  1774. unsigned int hw_id; /* id of the previous hardware message (or 0) */
  1775. unsigned int wake_mask; /* wakeup bits mask */
  1776. unsigned int changed_mask; /* changed bits mask */
  1777. @REPLY
  1778. user_handle_t win; /* window handle */
  1779. unsigned int msg; /* message code */
  1780. lparam_t wparam; /* parameters */
  1781. lparam_t lparam; /* parameters */
  1782. int type; /* message type */
  1783. int x; /* message x position */
  1784. int y; /* message y position */
  1785. unsigned int time; /* message time */
  1786. unsigned int active_hooks; /* active hooks bitmap */
  1787. data_size_t total; /* total size of extra data */
  1788. VARARG(data,message_data); /* message data for sent messages */
  1789. @END
  1790. /* Reply to a sent message */
  1791. @REQ(reply_message)
  1792. int remove; /* should we remove the message? */
  1793. lparam_t result; /* message result */
  1794. VARARG(data,bytes); /* message data for sent messages */
  1795. @END
  1796. /* Accept and remove the current hardware message */
  1797. @REQ(accept_hardware_message)
  1798. unsigned int hw_id; /* id of the hardware message */
  1799. @END
  1800. /* Retrieve the reply for the last message sent */
  1801. @REQ(get_message_reply)
  1802. int cancel; /* cancel message if not ready? */
  1803. @REPLY
  1804. lparam_t result; /* message result */
  1805. VARARG(data,bytes); /* message data for sent messages */
  1806. @END
  1807. /* Set a window timer */
  1808. @REQ(set_win_timer)
  1809. user_handle_t win; /* window handle */
  1810. unsigned int msg; /* message to post */
  1811. unsigned int rate; /* timer rate in ms */
  1812. lparam_t id; /* timer id */
  1813. lparam_t lparam; /* message lparam (callback proc) */
  1814. @REPLY
  1815. lparam_t id; /* timer id */
  1816. @END
  1817. /* Kill a window timer */
  1818. @REQ(kill_win_timer)
  1819. user_handle_t win; /* window handle */
  1820. lparam_t id; /* timer id */
  1821. unsigned int msg; /* message to post */
  1822. @END
  1823. /* check if the thread owning the window is hung */
  1824. @REQ(is_window_hung)
  1825. user_handle_t win; /* window handle */
  1826. @REPLY
  1827. int is_hung;
  1828. @END
  1829. /* Retrieve info about a serial port */
  1830. @REQ(get_serial_info)
  1831. obj_handle_t handle; /* handle to comm port */
  1832. int flags;
  1833. @REPLY
  1834. unsigned int eventmask;
  1835. unsigned int cookie;
  1836. unsigned int pending_write;
  1837. @END
  1838. /* Set info about a serial port */
  1839. @REQ(set_serial_info)
  1840. obj_handle_t handle; /* handle to comm port */
  1841. int flags; /* bitmask to set values (see below) */
  1842. @END
  1843. #define SERIALINFO_PENDING_WRITE 0x04
  1844. #define SERIALINFO_PENDING_WAIT 0x08
  1845. /* Create an async I/O */
  1846. @REQ(register_async)
  1847. int type; /* type of queue to look after */
  1848. async_data_t async; /* async I/O parameters */
  1849. int count; /* count - usually # of bytes to be read/written */
  1850. @END
  1851. #define ASYNC_TYPE_READ 0x01
  1852. #define ASYNC_TYPE_WRITE 0x02
  1853. #define ASYNC_TYPE_WAIT 0x03
  1854. /* Cancel all async op on a fd */
  1855. @REQ(cancel_async)
  1856. obj_handle_t handle; /* handle to comm port, socket or file */
  1857. client_ptr_t iosb; /* I/O status block (NULL=all) */
  1858. int only_thread; /* cancel matching this thread */
  1859. @END
  1860. /* Retrieve results of an async */
  1861. @REQ(get_async_result)
  1862. client_ptr_t user_arg; /* user arg used to identify async */
  1863. @REPLY
  1864. VARARG(out_data,bytes); /* iosb output data */
  1865. @END
  1866. /* Perform a read on a file object */
  1867. @REQ(read)
  1868. async_data_t async; /* async I/O parameters */
  1869. file_pos_t pos; /* read position */
  1870. @REPLY
  1871. obj_handle_t wait; /* handle to wait on for blocking read */
  1872. unsigned int options; /* device open options */
  1873. VARARG(data,bytes); /* read data */
  1874. @END
  1875. /* Perform a write on a file object */
  1876. @REQ(write)
  1877. async_data_t async; /* async I/O parameters */
  1878. file_pos_t pos; /* write position */
  1879. VARARG(data,bytes); /* write data */
  1880. @REPLY
  1881. obj_handle_t wait; /* handle to wait on for blocking write */
  1882. unsigned int options; /* device open options */
  1883. data_size_t size; /* size written */
  1884. @END
  1885. /* Perform an ioctl on a file */
  1886. @REQ(ioctl)
  1887. ioctl_code_t code; /* ioctl code */
  1888. async_data_t async; /* async I/O parameters */
  1889. VARARG(in_data,bytes); /* ioctl input data */
  1890. @REPLY
  1891. obj_handle_t wait; /* handle to wait on for blocking ioctl */
  1892. unsigned int options; /* device open options */
  1893. VARARG(out_data,bytes); /* ioctl output data */
  1894. @END
  1895. /* Store results of an async irp */
  1896. @REQ(set_irp_result)
  1897. obj_handle_t handle; /* handle to the irp */
  1898. unsigned int status; /* status of the irp */
  1899. data_size_t size; /* result size (input or output depending on the operation) */
  1900. VARARG(data,bytes); /* output data of the irp */
  1901. @END
  1902. /* Create a named pipe */
  1903. @REQ(create_named_pipe)
  1904. unsigned int access;
  1905. unsigned int options;
  1906. unsigned int sharing;
  1907. unsigned int maxinstances;
  1908. unsigned int outsize;
  1909. unsigned int insize;
  1910. timeout_t timeout;
  1911. unsigned int flags;
  1912. VARARG(objattr,object_attributes); /* object attributes */
  1913. @REPLY
  1914. obj_handle_t handle; /* handle to the pipe */
  1915. @END
  1916. /* flags in create_named_pipe and get_named_pipe_info */
  1917. #define NAMED_PIPE_MESSAGE_STREAM_WRITE 0x0001
  1918. #define NAMED_PIPE_MESSAGE_STREAM_READ 0x0002
  1919. #define NAMED_PIPE_NONBLOCKING_MODE 0x0004
  1920. #define NAMED_PIPE_SERVER_END 0x8000
  1921. /* Set named pipe information by handle */
  1922. @REQ(set_named_pipe_info)
  1923. obj_handle_t handle;
  1924. unsigned int flags;
  1925. @END
  1926. /* Create a window */
  1927. @REQ(create_window)
  1928. user_handle_t parent; /* parent window */
  1929. user_handle_t owner; /* owner window */
  1930. atom_t atom; /* class atom */
  1931. mod_handle_t instance; /* module instance */
  1932. int dpi; /* system DPI */
  1933. int awareness; /* thread DPI awareness */
  1934. unsigned int style; /* window style */
  1935. unsigned int ex_style; /* window extended style */
  1936. VARARG(class,unicode_str); /* class name */
  1937. @REPLY
  1938. user_handle_t handle; /* created window */
  1939. user_handle_t parent; /* full handle of parent */
  1940. user_handle_t owner; /* full handle of owner */
  1941. int extra; /* number of extra bytes */
  1942. client_ptr_t class_ptr; /* pointer to class in client address space */
  1943. int dpi; /* window DPI if not per-monitor aware */
  1944. int awareness; /* window DPI awareness */
  1945. @END
  1946. /* Destroy a window */
  1947. @REQ(destroy_window)
  1948. user_handle_t handle; /* handle to the window */
  1949. @END
  1950. /* Retrieve the desktop window for the current thread */
  1951. @REQ(get_desktop_window)
  1952. int force; /* force creation if it doesn't exist */
  1953. @REPLY
  1954. user_handle_t top_window; /* handle to the desktop window */
  1955. user_handle_t msg_window; /* handle to the top-level HWND_MESSAGE parent */
  1956. @END
  1957. /* Set a window owner */
  1958. @REQ(set_window_owner)
  1959. user_handle_t handle; /* handle to the window */
  1960. user_handle_t owner; /* new owner */
  1961. @REPLY
  1962. user_handle_t full_owner; /* full handle of new owner */
  1963. user_handle_t prev_owner; /* full handle of previous owner */
  1964. @END
  1965. /* Get information from a window handle */
  1966. @REQ(get_window_info)
  1967. user_handle_t handle; /* handle to the window */
  1968. @REPLY
  1969. user_handle_t full_handle; /* full 32-bit handle */
  1970. user_handle_t last_active; /* last active popup */
  1971. process_id_t pid; /* process owning the window */
  1972. thread_id_t tid; /* thread owning the window */
  1973. atom_t atom; /* class atom */
  1974. int is_unicode; /* ANSI or unicode */
  1975. int dpi; /* window DPI */
  1976. int awareness; /* DPI awareness */
  1977. @END
  1978. /* Set some information in a window */
  1979. @REQ(set_window_info)
  1980. unsigned short flags; /* flags for fields to set (see below) */
  1981. short int is_unicode; /* ANSI or unicode */
  1982. user_handle_t handle; /* handle to the window */
  1983. unsigned int style; /* window style */
  1984. unsigned int ex_style; /* window extended style */
  1985. unsigned int id; /* window id */
  1986. mod_handle_t instance; /* creator instance */
  1987. lparam_t user_data; /* user-specific data */
  1988. int extra_offset; /* offset to set in extra bytes */
  1989. data_size_t extra_size; /* size to set in extra bytes */
  1990. lparam_t extra_value; /* value to set in extra bytes */
  1991. @REPLY
  1992. unsigned int old_style; /* old window style */
  1993. unsigned int old_ex_style; /* old window extended style */
  1994. mod_handle_t old_instance; /* old creator instance */
  1995. lparam_t old_user_data; /* old user-specific data */
  1996. lparam_t old_extra_value; /* old value in extra bytes */
  1997. unsigned int old_id; /* old window id */
  1998. @END
  1999. #define SET_WIN_STYLE 0x01
  2000. #define SET_WIN_EXSTYLE 0x02
  2001. #define SET_WIN_ID 0x04
  2002. #define SET_WIN_INSTANCE 0x08
  2003. #define SET_WIN_USERDATA 0x10
  2004. #define SET_WIN_EXTRA 0x20
  2005. #define SET_WIN_UNICODE 0x40
  2006. /* Set the parent of a window */
  2007. @REQ(set_parent)
  2008. user_handle_t handle; /* handle to the window */
  2009. user_handle_t parent; /* handle to the parent */
  2010. @REPLY
  2011. user_handle_t old_parent; /* old parent window */
  2012. user_handle_t full_parent; /* full handle of new parent */
  2013. int dpi; /* new window DPI if not per-monitor aware */
  2014. int awareness; /* new DPI awareness */
  2015. @END
  2016. /* Get a list of the window parents, up to the root of the tree */
  2017. @REQ(get_window_parents)
  2018. user_handle_t handle; /* handle to the window */
  2019. @REPLY
  2020. int count; /* total count of parents */
  2021. VARARG(parents,user_handles); /* parent handles */
  2022. @END
  2023. /* Get a list of the window children */
  2024. @REQ(get_window_children)
  2025. obj_handle_t desktop; /* handle to desktop */
  2026. user_handle_t parent; /* parent window */
  2027. atom_t atom; /* class atom for the listed children */
  2028. thread_id_t tid; /* thread owning the listed children */
  2029. VARARG(class,unicode_str); /* class name */
  2030. @REPLY
  2031. int count; /* total count of children */
  2032. VARARG(children,user_handles); /* children handles */
  2033. @END
  2034. /* Get a list of the window children that contain a given point */
  2035. @REQ(get_window_children_from_point)
  2036. user_handle_t parent; /* parent window */
  2037. int x; /* point in parent coordinates */
  2038. int y;
  2039. int dpi; /* dpi for the point coordinates */
  2040. @REPLY
  2041. int count; /* total count of children */
  2042. VARARG(children,user_handles); /* children handles */
  2043. @END
  2044. /* Get window tree information from a window handle */
  2045. @REQ(get_window_tree)
  2046. user_handle_t handle; /* handle to the window */
  2047. @REPLY
  2048. user_handle_t parent; /* parent window */
  2049. user_handle_t owner; /* owner window */
  2050. user_handle_t next_sibling; /* next sibling in Z-order */
  2051. user_handle_t prev_sibling; /* prev sibling in Z-order */
  2052. user_handle_t first_sibling; /* first sibling in Z-order */
  2053. user_handle_t last_sibling; /* last sibling in Z-order */
  2054. user_handle_t first_child; /* first child */
  2055. user_handle_t last_child; /* last child */
  2056. @END
  2057. /* Set the position and Z order of a window */
  2058. @REQ(set_window_pos)
  2059. unsigned short swp_flags; /* SWP_* flags */
  2060. unsigned short paint_flags; /* paint flags (see below) */
  2061. user_handle_t handle; /* handle to the window */
  2062. user_handle_t previous; /* previous window in Z order */
  2063. rectangle_t window; /* window rectangle (in parent coords) */
  2064. rectangle_t client; /* client rectangle (in parent coords) */
  2065. VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in parent coords) */
  2066. @REPLY
  2067. unsigned int new_style; /* new window style */
  2068. unsigned int new_ex_style; /* new window extended style */
  2069. user_handle_t surface_win; /* parent window that holds the surface */
  2070. int needs_update; /* whether the surface region needs an update */
  2071. @END
  2072. #define SET_WINPOS_PAINT_SURFACE 0x01 /* window has a paintable surface */
  2073. #define SET_WINPOS_PIXEL_FORMAT 0x02 /* window has a custom pixel format */
  2074. /* Get the window and client rectangles of a window */
  2075. @REQ(get_window_rectangles)
  2076. user_handle_t handle; /* handle to the window */
  2077. int relative; /* coords relative to (see below) */
  2078. int dpi; /* DPI to map to, or zero for per-monitor DPI */
  2079. @REPLY
  2080. rectangle_t window; /* window rectangle */
  2081. rectangle_t client; /* client rectangle */
  2082. @END
  2083. enum coords_relative
  2084. {
  2085. COORDS_CLIENT, /* relative to client area */
  2086. COORDS_WINDOW, /* relative to whole window area */
  2087. COORDS_PARENT, /* relative to parent's client area */
  2088. COORDS_SCREEN /* relative to screen origin */
  2089. };
  2090. /* Get the window text */
  2091. @REQ(get_window_text)
  2092. user_handle_t handle; /* handle to the window */
  2093. @REPLY
  2094. data_size_t length; /* total length in WCHARs */
  2095. VARARG(text,unicode_str); /* window text */
  2096. @END
  2097. /* Set the window text */
  2098. @REQ(set_window_text)
  2099. user_handle_t handle; /* handle to the window */
  2100. VARARG(text,unicode_str); /* window text */
  2101. @END
  2102. /* Get the coordinates offset between two windows */
  2103. @REQ(get_windows_offset)
  2104. user_handle_t from; /* handle to the first window */
  2105. user_handle_t to; /* handle to the second window */
  2106. int dpi; /* DPI to map to, or zero for per-monitor DPI */
  2107. @REPLY
  2108. int x; /* x coordinate offset */
  2109. int y; /* y coordinate offset */
  2110. int mirror; /* whether to mirror the x coordinate */
  2111. @END
  2112. /* Get the visible region of a window */
  2113. @REQ(get_visible_region)
  2114. user_handle_t window; /* handle to the window */
  2115. unsigned int flags; /* DCX flags */
  2116. @REPLY
  2117. user_handle_t top_win; /* top window to clip against */
  2118. rectangle_t top_rect; /* top window visible rect with screen coords */
  2119. rectangle_t win_rect; /* window rect in screen coords */
  2120. unsigned int paint_flags; /* paint flags (from SET_WINPOS_* flags) */
  2121. data_size_t total_size; /* total size of the resulting region */
  2122. VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
  2123. @END
  2124. /* Get the visible surface region of a window */
  2125. @REQ(get_surface_region)
  2126. user_handle_t window; /* handle to the window */
  2127. @REPLY
  2128. rectangle_t visible_rect; /* window visible rect in screen coords */
  2129. data_size_t total_size; /* total size of the resulting region */
  2130. VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
  2131. @END
  2132. /* Get the window region */
  2133. @REQ(get_window_region)
  2134. user_handle_t window; /* handle to the window */
  2135. @REPLY
  2136. data_size_t total_size; /* total size of the resulting region */
  2137. VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
  2138. @END
  2139. /* Set the window region */
  2140. @REQ(set_window_region)
  2141. user_handle_t window; /* handle to the window */
  2142. int redraw; /* redraw the window? */
  2143. VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
  2144. @END
  2145. /* Get the window update region */
  2146. @REQ(get_update_region)
  2147. user_handle_t window; /* handle to the window */
  2148. user_handle_t from_child; /* child to start searching from */
  2149. unsigned int flags; /* update flags (see below) */
  2150. @REPLY
  2151. user_handle_t child; /* child to repaint (or window itself) */
  2152. unsigned int flags; /* resulting update flags (see below) */
  2153. data_size_t total_size; /* total size of the resulting region */
  2154. VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
  2155. @END
  2156. #define UPDATE_NONCLIENT 0x001 /* get region for repainting non-client area */
  2157. #define UPDATE_ERASE 0x002 /* get region for erasing client area */
  2158. #define UPDATE_PAINT 0x004 /* get region for painting client area */
  2159. #define UPDATE_INTERNALPAINT 0x008 /* get region if internal paint is pending */
  2160. #define UPDATE_ALLCHILDREN 0x010 /* force repaint of all children */
  2161. #define UPDATE_NOCHILDREN 0x020 /* don't try to repaint any children */
  2162. #define UPDATE_NOREGION 0x040 /* don't return a region, only the flags */
  2163. #define UPDATE_DELAYED_ERASE 0x080 /* still needs erase after BeginPaint */
  2164. #define UPDATE_CLIPCHILDREN 0x100 /* remove clipped children from the update region */
  2165. /* Update the z order of a window so that a given rectangle is fully visible */
  2166. @REQ(update_window_zorder)
  2167. user_handle_t window; /* handle to the window */
  2168. rectangle_t rect; /* rectangle that must be visible (in client coords) */
  2169. @END
  2170. /* Mark parts of a window as needing a redraw */
  2171. @REQ(redraw_window)
  2172. user_handle_t window; /* handle to the window */
  2173. unsigned int flags; /* RDW_* flags */
  2174. VARARG(region,rectangles); /* list of rectangles for the region (in window coords) */
  2175. @END
  2176. /* Set a window property */
  2177. @REQ(set_window_property)
  2178. user_handle_t window; /* handle to the window */
  2179. lparam_t data; /* data to store */
  2180. atom_t atom; /* property atom (if no name specified) */
  2181. VARARG(name,unicode_str); /* property name */
  2182. @END
  2183. /* Remove a window property */
  2184. @REQ(remove_window_property)
  2185. user_handle_t window; /* handle to the window */
  2186. atom_t atom; /* property atom (if no name specified) */
  2187. VARARG(name,unicode_str); /* property name */
  2188. @REPLY
  2189. lparam_t data; /* data stored in property */
  2190. @END
  2191. /* Get a window property */
  2192. @REQ(get_window_property)
  2193. user_handle_t window; /* handle to the window */
  2194. atom_t atom; /* property atom (if no name specified) */
  2195. VARARG(name,unicode_str); /* property name */
  2196. @REPLY
  2197. lparam_t data; /* data stored in property */
  2198. @END
  2199. /* Get the list of properties of a window */
  2200. @REQ(get_window_properties)
  2201. user_handle_t window; /* handle to the window */
  2202. @REPLY
  2203. int total; /* total number of properties */
  2204. VARARG(props,properties); /* list of properties */
  2205. @END
  2206. /* Create a window station */
  2207. @REQ(create_winstation)
  2208. unsigned int flags; /* window station flags */
  2209. unsigned int access; /* wanted access rights */
  2210. unsigned int attributes; /* object attributes */
  2211. obj_handle_t rootdir; /* root directory */
  2212. VARARG(name,unicode_str); /* object name */
  2213. @REPLY
  2214. obj_handle_t handle; /* handle to the window station */
  2215. @END
  2216. /* Open a handle to a window station */
  2217. @REQ(open_winstation)
  2218. unsigned int access; /* wanted access rights */
  2219. unsigned int attributes; /* object attributes */
  2220. obj_handle_t rootdir; /* root directory */
  2221. VARARG(name,unicode_str); /* object name */
  2222. @REPLY
  2223. obj_handle_t handle; /* handle to the window station */
  2224. @END
  2225. /* Close a window station */
  2226. @REQ(close_winstation)
  2227. obj_handle_t handle; /* handle to the window station */
  2228. @END
  2229. /* Get the process current window station */
  2230. @REQ(get_process_winstation)
  2231. @REPLY
  2232. obj_handle_t handle; /* handle to the window station */
  2233. @END
  2234. /* Set the process current window station */
  2235. @REQ(set_process_winstation)
  2236. obj_handle_t handle; /* handle to the window station */
  2237. @END
  2238. /* Enumerate window stations */
  2239. @REQ(enum_winstation)
  2240. unsigned int index; /* current index */
  2241. @REPLY
  2242. unsigned int next; /* next index */
  2243. VARARG(name,unicode_str); /* window station name */
  2244. @END
  2245. /* Create a desktop */
  2246. @REQ(create_desktop)
  2247. unsigned int flags; /* desktop flags */
  2248. unsigned int access; /* wanted access rights */
  2249. unsigned int attributes; /* object attributes */
  2250. VARARG(name,unicode_str); /* object name */
  2251. @REPLY
  2252. obj_handle_t handle; /* handle to the desktop */
  2253. @END
  2254. /* Open a handle to a desktop */
  2255. @REQ(open_desktop)
  2256. obj_handle_t winsta; /* window station to open (null allowed) */
  2257. unsigned int flags; /* desktop flags */
  2258. unsigned int access; /* wanted access rights */
  2259. unsigned int attributes; /* object attributes */
  2260. VARARG(name,unicode_str); /* object name */
  2261. @REPLY
  2262. obj_handle_t handle; /* handle to the desktop */
  2263. @END
  2264. /* Open a handle to current input desktop */
  2265. @REQ(open_input_desktop)
  2266. unsigned int flags; /* desktop flags */
  2267. unsigned int access; /* wanted access rights */
  2268. unsigned int attributes; /* object attributes */
  2269. @REPLY
  2270. obj_handle_t handle; /* handle to the desktop */
  2271. @END
  2272. /* Close a desktop */
  2273. @REQ(close_desktop)
  2274. obj_handle_t handle; /* handle to the desktop */
  2275. @END
  2276. /* Get the thread current desktop */
  2277. @REQ(get_thread_desktop)
  2278. thread_id_t tid; /* thread id */
  2279. @REPLY
  2280. obj_handle_t handle; /* handle to the desktop */
  2281. @END
  2282. /* Set the thread current desktop */
  2283. @REQ(set_thread_desktop)
  2284. obj_handle_t handle; /* handle to the desktop */
  2285. @END
  2286. /* Enumerate desktops */
  2287. @REQ(enum_desktop)
  2288. obj_handle_t winstation; /* handle to the window station */
  2289. unsigned int index; /* current index */
  2290. @REPLY
  2291. unsigned int next; /* next index */
  2292. VARARG(name,unicode_str); /* window station name */
  2293. @END
  2294. /* Get/set information about a user object (window station or desktop) */
  2295. @REQ(set_user_object_info)
  2296. obj_handle_t handle; /* handle to the object */
  2297. unsigned int flags; /* information to set/get */
  2298. unsigned int obj_flags; /* new object flags */
  2299. @REPLY
  2300. int is_desktop; /* is object a desktop? */
  2301. unsigned int old_obj_flags; /* old object flags */
  2302. VARARG(name,unicode_str); /* object name */
  2303. @END
  2304. #define SET_USER_OBJECT_SET_FLAGS 1
  2305. #define SET_USER_OBJECT_GET_FULL_NAME 2
  2306. /* Register a hotkey */
  2307. @REQ(register_hotkey)
  2308. user_handle_t window; /* handle to the window */
  2309. int id; /* hotkey identifier */
  2310. unsigned int flags; /* modifier keys */
  2311. unsigned int vkey; /* virtual key code */
  2312. @REPLY
  2313. int replaced; /* did we replace an existing hotkey? */
  2314. unsigned int flags; /* flags of replaced hotkey */
  2315. unsigned int vkey; /* virtual key code of replaced hotkey */
  2316. @END
  2317. /* Unregister a hotkey */
  2318. @REQ(unregister_hotkey)
  2319. user_handle_t window; /* handle to the window */
  2320. int id; /* hotkey identifier */
  2321. @REPLY
  2322. unsigned int flags; /* flags of removed hotkey */
  2323. unsigned int vkey; /* virtual key code of removed hotkey */
  2324. @END
  2325. /* Attach (or detach) thread inputs */
  2326. @REQ(attach_thread_input)
  2327. thread_id_t tid_from; /* thread to be attached */
  2328. thread_id_t tid_to; /* thread to which tid_from should be attached */
  2329. int attach; /* is it an attach? */
  2330. @END
  2331. /* Get input data for a given thread */
  2332. @REQ(get_thread_input)
  2333. thread_id_t tid; /* id of thread */
  2334. @REPLY
  2335. user_handle_t focus; /* handle to the focus window */
  2336. user_handle_t capture; /* handle to the capture window */
  2337. user_handle_t active; /* handle to the active window */
  2338. user_handle_t foreground; /* handle to the global foreground window */
  2339. user_handle_t menu_owner; /* handle to the menu owner */
  2340. user_handle_t move_size; /* handle to the moving/resizing window */
  2341. user_handle_t caret; /* handle to the caret window */
  2342. user_handle_t cursor; /* handle to the cursor */
  2343. int show_count; /* cursor show count */
  2344. rectangle_t rect; /* caret rectangle */
  2345. @END
  2346. /* Get the time of the last input event */
  2347. @REQ(get_last_input_time)
  2348. @REPLY
  2349. unsigned int time;
  2350. @END
  2351. /* Retrieve queue keyboard state for current thread or global async state */
  2352. @REQ(get_key_state)
  2353. int async; /* whether to query the async state */
  2354. int key; /* optional key code or -1 */
  2355. @REPLY
  2356. unsigned char state; /* state of specified key */
  2357. VARARG(keystate,bytes); /* state array for all the keys */
  2358. @END
  2359. /* Set queue keyboard state for current thread */
  2360. @REQ(set_key_state)
  2361. int async; /* whether to change the async state too */
  2362. VARARG(keystate,bytes); /* state array for all the keys */
  2363. @END
  2364. /* Set the system foreground window */
  2365. @REQ(set_foreground_window)
  2366. user_handle_t handle; /* handle to the foreground window */
  2367. @REPLY
  2368. user_handle_t previous; /* handle to the previous foreground window */
  2369. int send_msg_old; /* whether we have to send a msg to the old window */
  2370. int send_msg_new; /* whether we have to send a msg to the new window */
  2371. @END
  2372. /* Set the current thread focus window */
  2373. @REQ(set_focus_window)
  2374. user_handle_t handle; /* handle to the focus window */
  2375. @REPLY
  2376. user_handle_t previous; /* handle to the previous focus window */
  2377. @END
  2378. /* Set the current thread active window */
  2379. @REQ(set_active_window)
  2380. user_handle_t handle; /* handle to the active window */
  2381. @REPLY
  2382. user_handle_t previous; /* handle to the previous active window */
  2383. @END
  2384. /* Set the current thread capture window */
  2385. @REQ(set_capture_window)
  2386. user_handle_t handle; /* handle to the capture window */
  2387. unsigned int flags; /* capture flags (see below) */
  2388. @REPLY
  2389. user_handle_t previous; /* handle to the previous capture window */
  2390. user_handle_t full_handle; /* full 32-bit handle of new capture window */
  2391. @END
  2392. #define CAPTURE_MENU 0x01 /* capture is for a menu */
  2393. #define CAPTURE_MOVESIZE 0x02 /* capture is for moving/resizing */
  2394. /* Set the current thread caret window */
  2395. @REQ(set_caret_window)
  2396. user_handle_t handle; /* handle to the caret window */
  2397. int width; /* caret width */
  2398. int height; /* caret height */
  2399. @REPLY
  2400. user_handle_t previous; /* handle to the previous caret window */
  2401. rectangle_t old_rect; /* previous caret rectangle */
  2402. int old_hide; /* previous hide count */
  2403. int old_state; /* previous caret state (1=on, 0=off) */
  2404. @END
  2405. /* Set the current thread caret information */
  2406. @REQ(set_caret_info)
  2407. unsigned int flags; /* caret flags (see below) */
  2408. user_handle_t handle; /* handle to the caret window */
  2409. int x; /* caret x position */
  2410. int y; /* caret y position */
  2411. int hide; /* increment for hide count (can be negative to show it) */
  2412. int state; /* caret state (see below) */
  2413. @REPLY
  2414. user_handle_t full_handle; /* handle to the current caret window */
  2415. rectangle_t old_rect; /* previous caret rectangle */
  2416. int old_hide; /* previous hide count */
  2417. int old_state; /* previous caret state (1=on, 0=off) */
  2418. @END
  2419. #define SET_CARET_POS 0x01 /* set the caret position from x,y */
  2420. #define SET_CARET_HIDE 0x02 /* increment the caret hide count */
  2421. #define SET_CARET_STATE 0x04 /* set the caret on/off state */
  2422. enum caret_state
  2423. {
  2424. CARET_STATE_OFF, /* off */
  2425. CARET_STATE_ON, /* on */
  2426. CARET_STATE_TOGGLE, /* toggle current state */
  2427. CARET_STATE_ON_IF_MOVED /* on if the position differs, unchanged otherwise */
  2428. };
  2429. /* Set a window hook */
  2430. @REQ(set_hook)
  2431. int id; /* id of the hook */
  2432. process_id_t pid; /* id of process to set the hook into */
  2433. thread_id_t tid; /* id of thread to set the hook into */
  2434. int event_min;
  2435. int event_max;
  2436. client_ptr_t proc; /* hook procedure */
  2437. int flags;
  2438. int unicode; /* is it a unicode hook? */
  2439. VARARG(module,unicode_str); /* module name */
  2440. @REPLY
  2441. user_handle_t handle; /* handle to the hook */
  2442. unsigned int active_hooks; /* active hooks bitmap */
  2443. @END
  2444. /* Remove a window hook */
  2445. @REQ(remove_hook)
  2446. user_handle_t handle; /* handle to the hook */
  2447. client_ptr_t proc; /* hook procedure if handle is 0 */
  2448. int id; /* id of the hook if handle is 0 */
  2449. @REPLY
  2450. unsigned int active_hooks; /* active hooks bitmap */
  2451. @END
  2452. /* Start calling a hook chain */
  2453. @REQ(start_hook_chain)
  2454. int id; /* id of the hook */
  2455. int event; /* signalled event */
  2456. user_handle_t window; /* handle to the event window */
  2457. int object_id; /* object id for out of context winevent */
  2458. int child_id; /* child id for out of context winevent */
  2459. @REPLY
  2460. user_handle_t handle; /* handle to the next hook */
  2461. process_id_t pid; /* process id for low-level keyboard/mouse hooks */
  2462. thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
  2463. int unicode; /* is it a unicode hook? */
  2464. client_ptr_t proc; /* hook procedure */
  2465. unsigned int active_hooks; /* active hooks bitmap */
  2466. VARARG(module,unicode_str); /* module name */
  2467. @END
  2468. /* Finished calling a hook chain */
  2469. @REQ(finish_hook_chain)
  2470. int id; /* id of the hook */
  2471. @END
  2472. /* Get the hook information */
  2473. @REQ(get_hook_info)
  2474. user_handle_t handle; /* handle to the current hook */
  2475. int get_next; /* do we want info about current or next hook? */
  2476. int event; /* signalled event */
  2477. user_handle_t window; /* handle to the event window */
  2478. int object_id; /* object id for out of context winevent */
  2479. int child_id; /* child id for out of context winevent */
  2480. @REPLY
  2481. user_handle_t handle; /* handle to the hook */
  2482. int id; /* id of the hook */
  2483. process_id_t pid; /* process id for low-level keyboard/mouse hooks */
  2484. thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
  2485. client_ptr_t proc; /* hook procedure */
  2486. int unicode; /* is it a unicode hook? */
  2487. VARARG(module,unicode_str); /* module name */
  2488. @END
  2489. /* Create a window class */
  2490. @REQ(create_class)
  2491. int local; /* is it a local class? */
  2492. atom_t atom; /* class atom */
  2493. unsigned int style; /* class style */
  2494. mod_handle_t instance; /* module instance */
  2495. int extra; /* number of extra class bytes */
  2496. int win_extra; /* number of window extra bytes */
  2497. client_ptr_t client_ptr; /* pointer to class in client address space */
  2498. data_size_t name_offset; /* base class name offset for specified atom */
  2499. VARARG(name,unicode_str); /* class name */
  2500. @REPLY
  2501. atom_t atom; /* resulting class atom */
  2502. @END
  2503. /* Destroy a window class */
  2504. @REQ(destroy_class)
  2505. atom_t atom; /* class atom */
  2506. mod_handle_t instance; /* module instance */
  2507. VARARG(name,unicode_str); /* class name */
  2508. @REPLY
  2509. client_ptr_t client_ptr; /* pointer to class in client address space */
  2510. @END
  2511. /* Set some information in a class */
  2512. @REQ(set_class_info)
  2513. user_handle_t window; /* handle to the window */
  2514. unsigned int flags; /* flags for info to set (see below) */
  2515. atom_t atom; /* class atom */
  2516. unsigned int style; /* class style */
  2517. int win_extra; /* number of window extra bytes */
  2518. mod_handle_t instance; /* module instance */
  2519. int extra_offset; /* offset to set in extra bytes */
  2520. data_size_t extra_size; /* size to set in extra bytes */
  2521. lparam_t extra_value; /* value to set in extra bytes */
  2522. @REPLY
  2523. atom_t old_atom; /* previous class atom */
  2524. atom_t base_atom; /* base class atom */
  2525. mod_handle_t old_instance; /* previous module instance */
  2526. lparam_t old_extra_value; /* old value in extra bytes */
  2527. unsigned int old_style; /* previous class style */
  2528. int old_extra; /* previous number of class extra bytes */
  2529. int old_win_extra; /* previous number of window extra bytes */
  2530. @END
  2531. #define SET_CLASS_ATOM 0x0001
  2532. #define SET_CLASS_STYLE 0x0002
  2533. #define SET_CLASS_WINEXTRA 0x0004
  2534. #define SET_CLASS_INSTANCE 0x0008
  2535. #define SET_CLASS_EXTRA 0x0010
  2536. /* Open the clipboard */
  2537. @REQ(open_clipboard)
  2538. user_handle_t window; /* clipboard window */
  2539. @REPLY
  2540. user_handle_t owner; /* current clipboard owner */
  2541. @END
  2542. /* Close the clipboard */
  2543. @REQ(close_clipboard)
  2544. @REPLY
  2545. user_handle_t viewer; /* first clipboard viewer */
  2546. user_handle_t owner; /* current clipboard owner */
  2547. @END
  2548. /* Empty the clipboard and grab ownership */
  2549. @REQ(empty_clipboard)
  2550. @END
  2551. /* Add a data format to the clipboard */
  2552. @REQ(set_clipboard_data)
  2553. unsigned int format; /* clipboard format of the data */
  2554. unsigned int lcid; /* locale id to use for synthesizing text formats */
  2555. VARARG(data,bytes); /* data contents */
  2556. @REPLY
  2557. unsigned int seqno; /* sequence number for the set data */
  2558. @END
  2559. /* Fetch a data format from the clipboard */
  2560. @REQ(get_clipboard_data)
  2561. unsigned int format; /* clipboard format of the data */
  2562. int render; /* will we try to render it if missing? */
  2563. int cached; /* do we already have it in the client-side cache? */
  2564. unsigned int seqno; /* sequence number for the data in the cache */
  2565. @REPLY
  2566. unsigned int from; /* for synthesized data, format to generate it from */
  2567. user_handle_t owner; /* clipboard owner for delayed-rendered formats */
  2568. unsigned int seqno; /* sequence number for the originally set data */
  2569. data_size_t total; /* total data size */
  2570. VARARG(data,bytes); /* data contents */
  2571. @END
  2572. /* Retrieve a list of available formats */
  2573. @REQ(get_clipboard_formats)
  2574. unsigned int format; /* specific format to query, return all if 0 */
  2575. @REPLY
  2576. unsigned int count; /* count of available formats */
  2577. VARARG(formats,uints); /* array of available formats */
  2578. @END
  2579. /* Retrieve the next available format */
  2580. @REQ(enum_clipboard_formats)
  2581. unsigned int previous; /* previous format, or first if 0 */
  2582. @REPLY
  2583. unsigned int format; /* next format */
  2584. @END
  2585. /* Release ownership of the clipboard */
  2586. @REQ(release_clipboard)
  2587. user_handle_t owner; /* clipboard owner to release */
  2588. @REPLY
  2589. user_handle_t viewer; /* first clipboard viewer */
  2590. user_handle_t owner; /* current clipboard owner */
  2591. @END
  2592. /* Get clipboard information */
  2593. @REQ(get_clipboard_info)
  2594. @REPLY
  2595. user_handle_t window; /* clipboard window */
  2596. user_handle_t owner; /* clipboard owner */
  2597. user_handle_t viewer; /* clipboard viewer */
  2598. unsigned int seqno; /* current sequence number */
  2599. @END
  2600. /* Set the clipboard viewer window */
  2601. @REQ(set_clipboard_viewer)
  2602. user_handle_t viewer; /* clipboard viewer */
  2603. user_handle_t previous; /* if non-zero, check that this was the previous viewer */
  2604. @REPLY
  2605. user_handle_t old_viewer; /* previous clipboard viewer */
  2606. user_handle_t owner; /* clipboard owner */
  2607. @END
  2608. /* Add a clipboard listener window */
  2609. @REQ(add_clipboard_listener)
  2610. user_handle_t window; /* clipboard listener window */
  2611. @END
  2612. /* Remove a clipboard listener window */
  2613. @REQ(remove_clipboard_listener)
  2614. user_handle_t window; /* clipboard listener window */
  2615. @END
  2616. /* Open a security token */
  2617. @REQ(open_token)
  2618. obj_handle_t handle; /* handle to the thread or process */
  2619. unsigned int access; /* access rights to the new token */
  2620. unsigned int attributes;/* object attributes */
  2621. unsigned int flags; /* flags (see below) */
  2622. @REPLY
  2623. obj_handle_t token; /* handle to the token */
  2624. @END
  2625. #define OPEN_TOKEN_THREAD 1
  2626. #define OPEN_TOKEN_AS_SELF 2
  2627. /* Set/get the global windows */
  2628. @REQ(set_global_windows)
  2629. unsigned int flags; /* flags for fields to set (see below) */
  2630. user_handle_t shell_window; /* handle to the new shell window */
  2631. user_handle_t shell_listview; /* handle to the new shell listview window */
  2632. user_handle_t progman_window; /* handle to the new program manager window */
  2633. user_handle_t taskman_window; /* handle to the new task manager window */
  2634. @REPLY
  2635. user_handle_t old_shell_window; /* handle to the shell window */
  2636. user_handle_t old_shell_listview; /* handle to the shell listview window */
  2637. user_handle_t old_progman_window; /* handle to the new program manager window */
  2638. user_handle_t old_taskman_window; /* handle to the new task manager window */
  2639. @END
  2640. #define SET_GLOBAL_SHELL_WINDOWS 0x01 /* set both main shell and listview windows */
  2641. #define SET_GLOBAL_PROGMAN_WINDOW 0x02
  2642. #define SET_GLOBAL_TASKMAN_WINDOW 0x04
  2643. /* Adjust the privileges held by a token */
  2644. @REQ(adjust_token_privileges)
  2645. obj_handle_t handle; /* handle to the token */
  2646. int disable_all; /* disable all privileges? */
  2647. int get_modified_state; /* get modified privileges? */
  2648. VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to enable/disable/remove */
  2649. @REPLY
  2650. unsigned int len; /* total length in bytes required to store token privileges */
  2651. VARARG(privileges,LUID_AND_ATTRIBUTES); /* modified privileges */
  2652. @END
  2653. /* Retrieves the set of privileges held by or available to a token */
  2654. @REQ(get_token_privileges)
  2655. obj_handle_t handle; /* handle to the token */
  2656. @REPLY
  2657. unsigned int len; /* total length in bytes required to store token privileges */
  2658. VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
  2659. @END
  2660. /* Check the token has the required privileges */
  2661. @REQ(check_token_privileges)
  2662. obj_handle_t handle; /* handle to the token */
  2663. int all_required; /* are all the privileges required for the check to succeed? */
  2664. VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges to check */
  2665. @REPLY
  2666. int has_privileges; /* does the token have the required privileges? */
  2667. VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges held by or available to a token */
  2668. @END
  2669. @REQ(duplicate_token)
  2670. obj_handle_t handle; /* handle to the token to duplicate */
  2671. unsigned int access; /* access rights to the new token */
  2672. int primary; /* is the new token to be a primary one? */
  2673. int impersonation_level; /* impersonation level of the new token */
  2674. VARARG(objattr,object_attributes); /* object attributes */
  2675. @REPLY
  2676. obj_handle_t new_handle; /* duplicated handle */
  2677. @END
  2678. @REQ(filter_token)
  2679. obj_handle_t handle; /* handle to the token to duplicate */
  2680. unsigned int flags; /* flags */
  2681. data_size_t privileges_size; /* size of privileges */
  2682. VARARG(privileges,LUID_AND_ATTRIBUTES,privileges_size); /* privileges to remove from new token */
  2683. VARARG(disable_sids,SID); /* array of groups to remove from new token */
  2684. @REPLY
  2685. obj_handle_t new_handle; /* filtered handle */
  2686. @END
  2687. @REQ(access_check)
  2688. obj_handle_t handle; /* handle to the token */
  2689. unsigned int desired_access; /* desired access to the object */
  2690. generic_map_t mapping; /* mapping to specific rights */
  2691. VARARG(sd,security_descriptor); /* security descriptor to check */
  2692. @REPLY
  2693. unsigned int access_granted; /* access rights actually granted */
  2694. unsigned int access_status; /* was access granted? */
  2695. unsigned int privileges_len; /* length needed to store privileges */
  2696. VARARG(privileges,LUID_AND_ATTRIBUTES); /* privileges used during access check */
  2697. @END
  2698. @REQ(get_token_sid)
  2699. obj_handle_t handle; /* handle to the token */
  2700. unsigned int which_sid; /* which SID to retrieve from the token */
  2701. @REPLY
  2702. data_size_t sid_len; /* length needed to store sid */
  2703. VARARG(sid,SID); /* the sid specified by which_sid from the token */
  2704. @END
  2705. @REQ(get_token_groups)
  2706. obj_handle_t handle; /* handle to the token */
  2707. @REPLY
  2708. data_size_t user_len; /* length needed to store user */
  2709. VARARG(user,token_groups); /* groups the token's user belongs to */
  2710. @END
  2711. @REQ(get_token_default_dacl)
  2712. obj_handle_t handle; /* handle to the token */
  2713. @REPLY
  2714. data_size_t acl_len; /* length needed to store access control list */
  2715. VARARG(acl,ACL); /* access control list */
  2716. @END
  2717. @REQ(set_token_default_dacl)
  2718. obj_handle_t handle; /* handle to the token */
  2719. VARARG(acl,ACL); /* default dacl to set */
  2720. @END
  2721. @REQ(set_security_object)
  2722. obj_handle_t handle; /* handle to the object */
  2723. unsigned int security_info; /* which parts of security descriptor to set */
  2724. VARARG(sd,security_descriptor); /* security descriptor to set */
  2725. @END
  2726. @REQ(get_security_object)
  2727. obj_handle_t handle; /* handle to the object */
  2728. unsigned int security_info; /* which parts of security descriptor to get */
  2729. @REPLY
  2730. unsigned int sd_len; /* buffer size needed for sd */
  2731. VARARG(sd,security_descriptor); /* retrieved security descriptor */
  2732. @END
  2733. struct handle_info
  2734. {
  2735. process_id_t owner;
  2736. obj_handle_t handle;
  2737. unsigned int access;
  2738. unsigned int attributes;
  2739. unsigned int type;
  2740. };
  2741. /* Return a list of all opened handles */
  2742. @REQ(get_system_handles)
  2743. @REPLY
  2744. unsigned int count; /* number of handles */
  2745. VARARG(data,handle_infos); /* array of handle_infos */
  2746. @END
  2747. /* Create a mailslot */
  2748. @REQ(create_mailslot)
  2749. unsigned int access; /* wanted access rights */
  2750. timeout_t read_timeout;
  2751. unsigned int max_msgsize;
  2752. VARARG(objattr,object_attributes); /* object attributes */
  2753. @REPLY
  2754. obj_handle_t handle; /* handle to the mailslot */
  2755. @END
  2756. /* Set mailslot information */
  2757. @REQ(set_mailslot_info)
  2758. obj_handle_t handle; /* handle to the mailslot */
  2759. timeout_t read_timeout;
  2760. unsigned int flags;
  2761. @REPLY
  2762. timeout_t read_timeout;
  2763. unsigned int max_msgsize;
  2764. @END
  2765. #define MAILSLOT_SET_READ_TIMEOUT 1
  2766. /* Create a directory object */
  2767. @REQ(create_directory)
  2768. unsigned int access; /* access flags */
  2769. VARARG(objattr,object_attributes); /* object attributes */
  2770. @REPLY
  2771. obj_handle_t handle; /* handle to the directory */
  2772. @END
  2773. /* Open a directory object */
  2774. @REQ(open_directory)
  2775. unsigned int access; /* access flags */
  2776. unsigned int attributes; /* object attributes */
  2777. obj_handle_t rootdir; /* root directory */
  2778. VARARG(directory_name,unicode_str); /* Directory name */
  2779. @REPLY
  2780. obj_handle_t handle; /* handle to the directory */
  2781. @END
  2782. /* Get a directory entry by index */
  2783. @REQ(get_directory_entry)
  2784. obj_handle_t handle; /* handle to the directory */
  2785. unsigned int index; /* entry index */
  2786. @REPLY
  2787. data_size_t name_len; /* length of the entry name in bytes */
  2788. VARARG(name,unicode_str,name_len); /* entry name */
  2789. VARARG(type,unicode_str); /* entry type */
  2790. @END
  2791. /* Create a symbolic link object */
  2792. @REQ(create_symlink)
  2793. unsigned int access; /* access flags */
  2794. VARARG(objattr,object_attributes); /* object attributes */
  2795. VARARG(target_name,unicode_str); /* target name */
  2796. @REPLY
  2797. obj_handle_t handle; /* handle to the symlink */
  2798. @END
  2799. /* Open a symbolic link object */
  2800. @REQ(open_symlink)
  2801. unsigned int access; /* access flags */
  2802. unsigned int attributes; /* object attributes */
  2803. obj_handle_t rootdir; /* root directory */
  2804. VARARG(name,unicode_str); /* symlink name */
  2805. @REPLY
  2806. obj_handle_t handle; /* handle to the symlink */
  2807. @END
  2808. /* Query a symbolic link object */
  2809. @REQ(query_symlink)
  2810. obj_handle_t handle; /* handle to the symlink */
  2811. @REPLY
  2812. data_size_t total; /* total needed size for name */
  2813. VARARG(target_name,unicode_str); /* target name */
  2814. @END
  2815. /* Query basic object information */
  2816. @REQ(get_object_info)
  2817. obj_handle_t handle; /* handle to the object */
  2818. @REPLY
  2819. unsigned int access; /* granted access mask */
  2820. unsigned int ref_count; /* object ref count */
  2821. unsigned int handle_count; /* object handle count */
  2822. @END
  2823. /* Query the full name of an object */
  2824. @REQ(get_object_name)
  2825. obj_handle_t handle; /* handle to the object */
  2826. @REPLY
  2827. data_size_t total; /* total needed size for name */
  2828. VARARG(name,unicode_str); /* object name */
  2829. @END
  2830. /* Query object type name information */
  2831. @REQ(get_object_type)
  2832. obj_handle_t handle; /* handle to the object */
  2833. @REPLY
  2834. VARARG(info,object_type_info); /* type information */
  2835. @END
  2836. /* Query type information for all types */
  2837. @REQ(get_object_types)
  2838. @REPLY
  2839. int count; /* total count of object types */
  2840. VARARG(info,object_types_info); /* type information */
  2841. @END
  2842. /* Allocate a locally-unique identifier */
  2843. @REQ(allocate_locally_unique_id)
  2844. @REPLY
  2845. luid_t luid;
  2846. @END
  2847. /* Create a device manager */
  2848. @REQ(create_device_manager)
  2849. unsigned int access; /* wanted access rights */
  2850. unsigned int attributes; /* object attributes */
  2851. @REPLY
  2852. obj_handle_t handle; /* handle to the device */
  2853. @END
  2854. /* Create a device */
  2855. @REQ(create_device)
  2856. obj_handle_t rootdir; /* root directory */
  2857. client_ptr_t user_ptr; /* opaque ptr for use by client */
  2858. obj_handle_t manager; /* device manager */
  2859. VARARG(name,unicode_str); /* object name */
  2860. @END
  2861. /* Delete a device */
  2862. @REQ(delete_device)
  2863. obj_handle_t manager; /* handle to the device manager */
  2864. client_ptr_t device; /* pointer to the device */
  2865. @END
  2866. /* Retrieve the next pending device irp request */
  2867. @REQ(get_next_device_request)
  2868. obj_handle_t manager; /* handle to the device manager */
  2869. obj_handle_t prev; /* handle to the previous irp */
  2870. unsigned int status; /* status of the previous irp */
  2871. client_ptr_t user_ptr; /* user pointer of the previous irp */
  2872. int pending; /* was the previous irp marked pending? */
  2873. unsigned int iosb_status; /* IOSB status of the previous irp */
  2874. data_size_t result; /* IOSB result of the previous irp */
  2875. VARARG(data,bytes); /* output data of the previous irp */
  2876. @REPLY
  2877. irp_params_t params; /* irp parameters */
  2878. obj_handle_t next; /* handle to the next irp */
  2879. thread_id_t client_tid; /* tid of thread calling irp */
  2880. client_ptr_t client_thread; /* pointer to thread object of calling irp */
  2881. data_size_t in_size; /* total needed input size */
  2882. VARARG(next_data,bytes); /* input data of the next irp */
  2883. @END
  2884. /* Get kernel pointer from server object */
  2885. @REQ(get_kernel_object_ptr)
  2886. obj_handle_t manager; /* handle to the device manager */
  2887. obj_handle_t handle; /* object handle */
  2888. @REPLY
  2889. client_ptr_t user_ptr; /* kernel object pointer */
  2890. @END
  2891. /* Associate kernel pointer with server object */
  2892. @REQ(set_kernel_object_ptr)
  2893. obj_handle_t manager; /* handle to the device manager */
  2894. obj_handle_t handle; /* object handle */
  2895. client_ptr_t user_ptr; /* kernel object pointer */
  2896. @END
  2897. /* Grab server object reference from kernel object pointer */
  2898. @REQ(grab_kernel_object)
  2899. obj_handle_t manager; /* handle to the device manager */
  2900. client_ptr_t user_ptr; /* kernel object pointer */
  2901. @END
  2902. /* Release server object reference from kernel object pointer */
  2903. @REQ(release_kernel_object)
  2904. obj_handle_t manager; /* handle to the device manager */
  2905. client_ptr_t user_ptr; /* kernel object pointer */
  2906. @END
  2907. /* Get handle from kernel object pointer */
  2908. @REQ(get_kernel_object_handle)
  2909. obj_handle_t manager; /* handle to the device manager */
  2910. client_ptr_t user_ptr; /* kernel object pointer */
  2911. unsigned int access; /* wanted access rights */
  2912. @REPLY
  2913. obj_handle_t handle; /* kernel object handle */
  2914. @END
  2915. /* Make the current process a system process */
  2916. @REQ(make_process_system)
  2917. obj_handle_t handle; /* handle to the process */
  2918. @REPLY
  2919. obj_handle_t event; /* event signaled when all user processes have exited */
  2920. @END
  2921. /* Get detailed fixed-size information about a token */
  2922. @REQ(get_token_info)
  2923. obj_handle_t handle; /* handle to the object */
  2924. @REPLY
  2925. luid_t token_id; /* locally-unique identifier of the token */
  2926. luid_t modified_id; /* locally-unique identifier of the modified version of the token */
  2927. unsigned int session_id; /* token session id */
  2928. int primary; /* is the token primary or impersonation? */
  2929. int impersonation_level; /* level of impersonation */
  2930. int elevation; /* elevation type */
  2931. int group_count; /* the number of groups the token is a member of */
  2932. int privilege_count; /* the number of privileges the token has */
  2933. @END
  2934. /* Create a token which is an elevation counterpart to this token */
  2935. @REQ(create_linked_token)
  2936. obj_handle_t handle; /* handle to the token */
  2937. @REPLY
  2938. obj_handle_t linked; /* handle to the linked token */
  2939. @END
  2940. /* Create I/O completion port */
  2941. @REQ(create_completion)
  2942. unsigned int access; /* desired access to a port */
  2943. unsigned int concurrent; /* max number of concurrent active threads */
  2944. VARARG(objattr,object_attributes); /* object attributes */
  2945. @REPLY
  2946. obj_handle_t handle; /* port handle */
  2947. @END
  2948. /* Open I/O completion port */
  2949. @REQ(open_completion)
  2950. unsigned int access; /* desired access to a port */
  2951. unsigned int attributes; /* object attributes */
  2952. obj_handle_t rootdir; /* root directory */
  2953. VARARG(filename,unicode_str); /* port name */
  2954. @REPLY
  2955. obj_handle_t handle; /* port handle */
  2956. @END
  2957. /* add completion to completion port */
  2958. @REQ(add_completion)
  2959. obj_handle_t handle; /* port handle */
  2960. apc_param_t ckey; /* completion key */
  2961. apc_param_t cvalue; /* completion value */
  2962. apc_param_t information; /* IO_STATUS_BLOCK Information */
  2963. unsigned int status; /* completion result */
  2964. @END
  2965. /* get completion from completion port queue */
  2966. @REQ(remove_completion)
  2967. obj_handle_t handle; /* port handle */
  2968. @REPLY
  2969. apc_param_t ckey; /* completion key */
  2970. apc_param_t cvalue; /* completion value */
  2971. apc_param_t information; /* IO_STATUS_BLOCK Information */
  2972. unsigned int status; /* completion result */
  2973. @END
  2974. /* get completion queue depth */
  2975. @REQ(query_completion)
  2976. obj_handle_t handle; /* port handle */
  2977. @REPLY
  2978. unsigned int depth; /* completion queue depth */
  2979. @END
  2980. /* associate object with completion port */
  2981. @REQ(set_completion_info)
  2982. obj_handle_t handle; /* object handle */
  2983. apc_param_t ckey; /* completion key */
  2984. obj_handle_t chandle; /* port handle */
  2985. @END
  2986. /* check for associated completion and push msg */
  2987. @REQ(add_fd_completion)
  2988. obj_handle_t handle; /* async' object */
  2989. apc_param_t cvalue; /* completion value */
  2990. apc_param_t information; /* IO_STATUS_BLOCK Information */
  2991. unsigned int status; /* completion status */
  2992. int async; /* completion is an async result */
  2993. @END
  2994. /* set fd completion information */
  2995. @REQ(set_fd_completion_mode)
  2996. obj_handle_t handle; /* handle to a file or directory */
  2997. unsigned int flags; /* completion notification flags */
  2998. @END
  2999. /* set fd disposition information */
  3000. @REQ(set_fd_disp_info)
  3001. obj_handle_t handle; /* handle to a file or directory */
  3002. int unlink; /* whether to unlink file on close */
  3003. @END
  3004. /* set fd name information */
  3005. @REQ(set_fd_name_info)
  3006. obj_handle_t handle; /* handle to a file or directory */
  3007. obj_handle_t rootdir; /* root directory */
  3008. data_size_t namelen; /* length of NT name in bytes */
  3009. int link; /* link instead of renaming */
  3010. int replace; /* replace an existing file? */
  3011. VARARG(name,unicode_str,namelen); /* NT name */
  3012. VARARG(filename,string); /* new file name */
  3013. @END
  3014. /* set fd eof information */
  3015. @REQ(set_fd_eof_info)
  3016. obj_handle_t handle; /* handle to a file or directory */
  3017. file_pos_t eof; /* offset of eof of file */
  3018. @END
  3019. /* Retrieve layered info for a window */
  3020. @REQ(get_window_layered_info)
  3021. user_handle_t handle; /* handle to the window */
  3022. @REPLY
  3023. unsigned int color_key; /* color key */
  3024. unsigned int alpha; /* alpha (0..255) */
  3025. unsigned int flags; /* LWA_* flags */
  3026. @END
  3027. /* Set layered info for a window */
  3028. @REQ(set_window_layered_info)
  3029. user_handle_t handle; /* handle to the window */
  3030. unsigned int color_key; /* color key */
  3031. unsigned int alpha; /* alpha (0..255) */
  3032. unsigned int flags; /* LWA_* flags */
  3033. @END
  3034. /* Allocate an arbitrary user handle */
  3035. @REQ(alloc_user_handle)
  3036. @REPLY
  3037. user_handle_t handle; /* allocated handle */
  3038. @END
  3039. /* Free an arbitrary user handle */
  3040. @REQ(free_user_handle)
  3041. user_handle_t handle; /* handle to free*/
  3042. @END
  3043. /* Set/get the current cursor */
  3044. @REQ(set_cursor)
  3045. unsigned int flags; /* flags for fields to set (see below) */
  3046. user_handle_t handle; /* handle to the cursor */
  3047. int show_count; /* show count increment/decrement */
  3048. int x; /* cursor position */
  3049. int y;
  3050. rectangle_t clip; /* cursor clip rectangle */
  3051. unsigned int clip_msg; /* message to post on cursor clip changes */
  3052. @REPLY
  3053. user_handle_t prev_handle; /* previous handle */
  3054. int prev_count; /* previous show count */
  3055. int prev_x; /* previous position */
  3056. int prev_y;
  3057. int new_x; /* new position */
  3058. int new_y;
  3059. rectangle_t new_clip; /* new clip rectangle */
  3060. unsigned int last_change; /* time of last position change */
  3061. @END
  3062. #define SET_CURSOR_HANDLE 0x01
  3063. #define SET_CURSOR_COUNT 0x02
  3064. #define SET_CURSOR_POS 0x04
  3065. #define SET_CURSOR_CLIP 0x08
  3066. #define SET_CURSOR_NOCLIP 0x10
  3067. /* Get the history of the 64 last cursor positions */
  3068. @REQ(get_cursor_history)
  3069. @REPLY
  3070. VARARG(history,cursor_positions);
  3071. @END
  3072. /* Batch read rawinput message data */
  3073. @REQ(get_rawinput_buffer)
  3074. data_size_t rawinput_size; /* size of RAWINPUT structure */
  3075. data_size_t buffer_size; /* size of output buffer */
  3076. @REPLY
  3077. data_size_t next_size; /* minimum size to get next message data */
  3078. unsigned int count;
  3079. VARARG(data,bytes);
  3080. @END
  3081. /* Modify the list of registered rawinput devices */
  3082. @REQ(update_rawinput_devices)
  3083. VARARG(devices,rawinput_devices);
  3084. @END
  3085. /* Retrieve the list of registered rawinput devices */
  3086. @REQ(get_rawinput_devices)
  3087. @REPLY
  3088. unsigned int device_count;
  3089. VARARG(devices,rawinput_devices);
  3090. @END
  3091. /* Create a new job object */
  3092. @REQ(create_job)
  3093. unsigned int access; /* wanted access rights */
  3094. VARARG(objattr,object_attributes); /* object attributes */
  3095. @REPLY
  3096. obj_handle_t handle; /* handle to the job */
  3097. @END
  3098. /* Open a job object */
  3099. @REQ(open_job)
  3100. unsigned int access; /* wanted access rights */
  3101. unsigned int attributes; /* object attributes */
  3102. obj_handle_t rootdir; /* root directory */
  3103. VARARG(name,unicode_str); /* object name */
  3104. @REPLY
  3105. obj_handle_t handle; /* handle to the job */
  3106. @END
  3107. /* Assign a job object to a process */
  3108. @REQ(assign_job)
  3109. obj_handle_t job; /* handle to the job */
  3110. obj_handle_t process; /* handle to the process */
  3111. @END
  3112. /* Check if a process is associated with a job */
  3113. @REQ(process_in_job)
  3114. obj_handle_t job; /* handle to the job */
  3115. obj_handle_t process; /* handle to the process */
  3116. @END
  3117. /* Set limit flags on a job */
  3118. @REQ(set_job_limits)
  3119. obj_handle_t handle; /* handle to the job */
  3120. unsigned int limit_flags; /* new limit flags */
  3121. @END
  3122. /* Set new completion port for a job */
  3123. @REQ(set_job_completion_port)
  3124. obj_handle_t job; /* handle to the job */
  3125. obj_handle_t port; /* handle to the completion port */
  3126. client_ptr_t key; /* key to send with completion messages */
  3127. @END
  3128. /* Retrieve information about a job */
  3129. @REQ(get_job_info)
  3130. obj_handle_t handle; /* handle to the job */
  3131. @REPLY
  3132. int total_processes; /* total count of processes */
  3133. int active_processes; /* count of running processes */
  3134. VARARG(pids,uints); /* list of active pids */
  3135. @END
  3136. /* Terminate all processes associated with the job */
  3137. @REQ(terminate_job)
  3138. obj_handle_t handle; /* handle to the job */
  3139. int status; /* process exit code */
  3140. @END
  3141. /* Suspend a process */
  3142. @REQ(suspend_process)
  3143. obj_handle_t handle; /* process handle */
  3144. @END
  3145. /* Resume a process */
  3146. @REQ(resume_process)
  3147. obj_handle_t handle; /* process handle */
  3148. @END
  3149. /* Iterate thread list for process */
  3150. @REQ(get_next_thread)
  3151. obj_handle_t process; /* process handle */
  3152. obj_handle_t last; /* thread handle to start with */
  3153. unsigned int access; /* desired access for returned handle */
  3154. unsigned int attributes; /* returned handle attributes */
  3155. unsigned int flags; /* controls iteration direction */
  3156. @REPLY
  3157. obj_handle_t handle; /* next thread handle */
  3158. @END