1 /* 2 * PROJECT: ReactOS Kernel 3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 * PURPOSE: Info Classes for the Process Manager 5 * COPYRIGHT: Copyright Alex Ionescu <alex.ionescu@reactos.org> 6 * Copyright Thomas Weidenmueller <w3seek@reactos.org> 7 * Copyright 2020-2021 George Bișoc <george.bisoc@reactos.org> 8 */ 9 10 #include "icif.h" 11 12 // 13 // Process Information Classes 14 // 15 static const INFORMATION_CLASS_INFO PsProcessInfoClass[] = 16 { 17 /* ProcessBasicInformation */ 18 IQS_SAME 19 ( 20 PROCESS_BASIC_INFORMATION, 21 ULONG, 22 ICIF_QUERY 23 ), 24 25 /* ProcessQuotaLimits */ 26 IQS_SAME 27 ( 28 QUOTA_LIMITS, 29 ULONG, 30 ICIF_QUERY | ICIF_SET | ICIF_SET_SIZE_VARIABLE 31 ), 32 33 /* ProcessIoCounters */ 34 IQS_SAME 35 ( 36 IO_COUNTERS, 37 ULONG, 38 ICIF_QUERY 39 ), 40 41 /* ProcessVmCounters */ 42 IQS_SAME 43 ( 44 VM_COUNTERS, 45 ULONG, 46 ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE 47 ), 48 49 /* ProcessTimes */ 50 IQS_SAME 51 ( 52 KERNEL_USER_TIMES, 53 ULONG, 54 ICIF_QUERY 55 ), 56 57 /* ProcessBasePriority */ 58 IQS_SAME 59 ( 60 KPRIORITY, 61 ULONG, 62 ICIF_SET 63 ), 64 65 /* ProcessRaisePriority */ 66 IQS_SAME 67 ( 68 ULONG, 69 ULONG, 70 ICIF_SET 71 ), 72 73 /* ProcessDebugPort */ 74 IQS_SAME 75 ( 76 HANDLE, 77 ULONG, 78 ICIF_QUERY 79 ), 80 81 /* ProcessExceptionPort */ 82 IQS_SAME 83 ( 84 HANDLE, 85 ULONG, 86 ICIF_SET 87 ), 88 89 /* ProcessAccessToken */ 90 IQS_SAME 91 ( 92 PROCESS_ACCESS_TOKEN, 93 ULONG, 94 ICIF_SET 95 ), 96 97 /* ProcessLdtInformation */ 98 IQS_SAME 99 ( 100 PROCESS_LDT_INFORMATION, 101 ULONG, 102 ICIF_QUERY | ICIF_SET 103 ), 104 105 /* ProcessLdtSize */ 106 IQS_SAME 107 ( 108 PROCESS_LDT_SIZE, 109 ULONG, 110 ICIF_SET 111 ), 112 113 /* ProcessDefaultHardErrorMode */ 114 IQS_SAME 115 ( 116 ULONG, 117 ULONG, 118 ICIF_QUERY | ICIF_SET 119 ), 120 121 /* ProcessIoPortHandlers */ 122 IQS_SAME 123 ( 124 UCHAR, 125 ULONG, 126 ICIF_SET 127 ), 128 129 /* ProcessPooledUsageAndLimits */ 130 IQS_SAME 131 ( 132 POOLED_USAGE_AND_LIMITS, 133 ULONG, 134 ICIF_QUERY 135 ), 136 137 /* ProcessWorkingSetWatch */ 138 IQS_SAME 139 ( 140 PROCESS_WS_WATCH_INFORMATION, 141 ULONG, 142 ICIF_QUERY | ICIF_SET | ICIF_SET_SIZE_VARIABLE 143 ), 144 145 /* ProcessUserModeIOPL is only implemented in x86 */ 146 #if defined (_X86_) 147 IQS_NO_TYPE_LENGTH 148 ( 149 ULONG, 150 ICIF_SET 151 ), 152 #else 153 IQS_NONE, 154 #endif 155 156 /* ProcessEnableAlignmentFaultFixup */ 157 IQS 158 ( 159 BOOLEAN, 160 CHAR, 161 BOOLEAN, 162 CHAR, 163 ICIF_SET 164 ), 165 166 /* ProcessPriorityClass */ 167 IQS 168 ( 169 PROCESS_PRIORITY_CLASS, 170 ULONG, 171 PROCESS_PRIORITY_CLASS, 172 CHAR, 173 ICIF_QUERY | ICIF_SET 174 ), 175 176 /* ProcessWx86Information */ 177 IQS_SAME 178 ( 179 ULONG, 180 ULONG, 181 ICIF_QUERY | ICIF_SET 182 ), 183 184 /* ProcessHandleCount */ 185 IQS_SAME 186 ( 187 ULONG, 188 ULONG, 189 ICIF_QUERY 190 ), 191 192 /* ProcessAffinityMask */ 193 IQS_SAME 194 ( 195 KAFFINITY, 196 ULONG, 197 ICIF_SET 198 ), 199 200 /* ProcessPriorityBoost */ 201 IQS_SAME 202 ( 203 ULONG, 204 ULONG, 205 ICIF_QUERY | ICIF_SET 206 ), 207 208 /* ProcessDeviceMap */ 209 IQS 210 ( 211 RTL_FIELD_TYPE(PROCESS_DEVICEMAP_INFORMATION, Query), 212 ULONG, 213 RTL_FIELD_TYPE(PROCESS_DEVICEMAP_INFORMATION, Set), 214 ULONG, 215 ICIF_QUERY | ICIF_SET 216 ), 217 218 /* ProcessSessionInformation */ 219 IQS_SAME 220 ( 221 PROCESS_SESSION_INFORMATION, 222 ULONG, 223 ICIF_QUERY | ICIF_SET 224 ), 225 226 /* ProcessForegroundInformation */ 227 IQS 228 ( 229 CHAR, 230 CHAR, 231 BOOLEAN, 232 CHAR, 233 ICIF_SET 234 ), 235 236 /* ProcessWow64Information */ 237 IQS_SAME 238 ( 239 ULONG_PTR, 240 ULONG, 241 ICIF_QUERY 242 ), 243 244 /* ProcessImageFileName */ 245 IQS_SAME 246 ( 247 UNICODE_STRING, 248 ULONG, 249 ICIF_QUERY | ICIF_QUERY_SIZE_VARIABLE 250 ), 251 252 /* ProcessLUIDDeviceMapsEnabled */ 253 IQS_SAME 254 ( 255 ULONG, 256 ULONG, 257 ICIF_QUERY 258 ), 259 260 /* ProcessBreakOnTermination */ 261 IQS_SAME 262 ( 263 ULONG, 264 ULONG, 265 ICIF_QUERY | ICIF_SET 266 ), 267 268 /* ProcessDebugObjectHandle */ 269 IQS_SAME 270 ( 271 HANDLE, 272 ULONG, 273 ICIF_QUERY 274 ), 275 276 /* ProcessDebugFlags */ 277 IQS_SAME 278 ( 279 ULONG, 280 ULONG, 281 ICIF_QUERY | ICIF_SET 282 ), 283 284 /* ProcessHandleTracing */ 285 IQS 286 ( 287 PROCESS_HANDLE_TRACING_QUERY, 288 ULONG, 289 ULONG, 290 ULONG, 291 ICIF_QUERY | ICIF_SET 292 ), 293 294 /* ProcessIoPriority */ 295 IQS_NONE, 296 297 /* ProcessExecuteFlags */ 298 IQS_SAME 299 ( 300 ULONG, 301 ULONG, 302 ICIF_QUERY | ICIF_SET 303 ), 304 305 /* ProcessTlsInformation */ 306 IQS_NONE, 307 308 /* ProcessCookie */ 309 IQS_SAME 310 ( 311 ULONG, 312 ULONG, 313 ICIF_QUERY 314 ), 315 316 /* ProcessImageInformation */ 317 IQS_SAME 318 ( 319 SECTION_IMAGE_INFORMATION, 320 ULONG, 321 ICIF_QUERY 322 ), 323 324 /* ProcessCycleTime */ 325 IQS_NONE, 326 327 /* ProcessPagePriority */ 328 IQS_NONE, 329 330 /* ProcessInstrumentationCallback */ 331 IQS_NONE, 332 333 /* ProcessThreadStackAllocation */ 334 IQS_NONE, 335 336 /* ProcessWorkingSetWatchEx */ 337 IQS_NONE, 338 339 /* ProcessImageFileNameWin32 */ 340 IQS_SAME 341 ( 342 CHAR, 343 CHAR, 344 ICIF_NONE 345 ), 346 347 /* ProcessImageFileMapping */ 348 IQS_NONE, 349 350 /* ProcessAffinityUpdateMode */ 351 IQS_NONE, 352 353 /* ProcessMemoryAllocationMode */ 354 IQS_NONE, 355 }; 356 357 // 358 // Thread Information Classes 359 // 360 static const INFORMATION_CLASS_INFO PsThreadInfoClass[] = 361 { 362 /* ThreadBasicInformation */ 363 IQS_SAME 364 ( 365 THREAD_BASIC_INFORMATION, 366 ULONG, 367 ICIF_QUERY 368 ), 369 370 /* ThreadTimes */ 371 IQS_SAME 372 ( 373 KERNEL_USER_TIMES, 374 ULONG, 375 ICIF_QUERY 376 ), 377 378 /* ThreadPriority */ 379 IQS_SAME 380 ( 381 KPRIORITY, 382 ULONG, 383 ICIF_SET 384 ), 385 386 /* ThreadBasePriority */ 387 IQS_SAME 388 ( 389 LONG, 390 ULONG, 391 ICIF_SET 392 ), 393 394 /* ThreadAffinityMask */ 395 IQS_SAME 396 ( 397 KAFFINITY, 398 ULONG, 399 ICIF_SET 400 ), 401 402 /* ThreadImpersonationToken */ 403 IQS_SAME 404 ( 405 HANDLE, 406 ULONG, 407 ICIF_SET 408 ), 409 410 /* ThreadDescriptorTableEntry is only implemented in x86 as well as the descriptor entry */ 411 #if defined(_X86_) 412 /* ThreadDescriptorTableEntry */ 413 IQS_SAME 414 ( 415 DESCRIPTOR_TABLE_ENTRY, 416 ULONG, 417 ICIF_QUERY 418 ), 419 #else 420 IQS_NONE, 421 #endif 422 423 /* ThreadEnableAlignmentFaultFixup */ 424 IQS 425 ( 426 CHAR, 427 CHAR, 428 BOOLEAN, 429 UCHAR, 430 ICIF_SET 431 ), 432 433 /* ThreadEventPair_Reusable */ 434 IQS_NONE, 435 436 /* ThreadQuerySetWin32StartAddress */ 437 IQS 438 ( 439 PVOID, 440 ULONG, 441 ULONG_PTR, 442 ULONG, 443 ICIF_QUERY | ICIF_SET 444 ), 445 446 /* ThreadZeroTlsCell */ 447 IQS_SAME 448 ( 449 ULONG, 450 ULONG, 451 ICIF_SET 452 ), 453 454 /* ThreadPerformanceCount */ 455 IQS_SAME 456 ( 457 LARGE_INTEGER, 458 ULONG, 459 ICIF_QUERY 460 ), 461 462 /* ThreadAmILastThread */ 463 IQS_SAME 464 ( 465 ULONG, 466 ULONG, 467 ICIF_QUERY 468 ), 469 470 /* ThreadIdealProcessor */ 471 IQS_SAME 472 ( 473 ULONG_PTR, 474 ULONG, 475 ICIF_SET 476 ), 477 478 /* ThreadPriorityBoost */ 479 IQS 480 ( 481 ULONG, 482 ULONG, 483 ULONG_PTR, 484 ULONG, 485 ICIF_QUERY | ICIF_SET 486 ), 487 488 /* ThreadSetTlsArrayAddress */ 489 IQS_SAME 490 ( 491 PVOID, 492 ULONG, 493 ICIF_SET | ICIF_SIZE_VARIABLE 494 ), 495 496 /* ThreadIsIoPending */ 497 IQS_SAME 498 ( 499 ULONG, 500 ULONG, 501 ICIF_QUERY 502 ), 503 504 /* ThreadHideFromDebugger */ 505 IQS_SAME 506 ( 507 CHAR, 508 ULONG, 509 ICIF_SET | ICIF_SET_SIZE_VARIABLE 510 ), 511 512 /* ThreadBreakOnTermination */ 513 IQS_SAME 514 ( 515 ULONG, 516 ULONG, 517 ICIF_QUERY | ICIF_SET 518 ), 519 520 /* ThreadSwitchLegacyState */ 521 IQS_SAME 522 ( 523 ULONG, 524 ULONG, 525 ICIF_SET 526 ), 527 528 /* ThreadIsTerminated */ 529 IQS_SAME 530 ( 531 ULONG, 532 ULONG, 533 ICIF_QUERY 534 ), 535 536 /* ThreadLastSystemCall */ 537 IQS_NONE, 538 539 /* ThreadIoPriority */ 540 IQS_NONE, 541 542 /* ThreadCycleTime */ 543 IQS_NONE, 544 545 /* ThreadPagePriority */ 546 IQS_NONE, 547 548 /* ThreadActualBasePriority */ 549 IQS_NONE, 550 551 /* ThreadTebInformation */ 552 IQS_NONE, 553 554 /* ThreadCSwitchMon */ 555 IQS_NONE, 556 }; 557