protocol.def 144 KB

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