protocol.def 125 KB

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