struct32.h 15.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * 32-bit version of ntdll structures
 *
 * Copyright 2021 Alexandre Julliard
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef __WOW64_STRUCT32_H
#define __WOW64_STRUCT32_H

24 25
#include "wine/server.h"

26 27 28 29 30 31 32 33 34 35
typedef struct
{
    ULONG Length;
    ULONG RootDirectory;
    ULONG ObjectName;
    ULONG Attributes;
    ULONG SecurityDescriptor;
    ULONG SecurityQualityOfService;
} OBJECT_ATTRIBUTES32;

36 37 38 39 40 41 42 43 44 45
typedef struct
{
    union
    {
        NTSTATUS Status;
        ULONG Pointer;
    };
    ULONG Information;
} IO_STATUS_BLOCK32;

46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
typedef struct
{
    UNICODE_STRING32 Name;
} OBJECT_NAME_INFORMATION32;

typedef struct
{
    UNICODE_STRING32 TypeName;
    ULONG            TotalNumberOfObjects;
    ULONG            TotalNumberOfHandles;
    ULONG            TotalPagedPoolUsage;
    ULONG            TotalNonPagedPoolUsage;
    ULONG            TotalNamePoolUsage;
    ULONG            TotalHandleTableUsage;
    ULONG            HighWaterNumberOfObjects;
    ULONG            HighWaterNumberOfHandles;
    ULONG            HighWaterPagedPoolUsage;
    ULONG            HighWaterNonPagedPoolUsage;
    ULONG            HighWaterNamePoolUsage;
    ULONG            HighWaterHandleTableUsage;
    ULONG            InvalidAttributes;
    GENERIC_MAPPING  GenericMapping;
    ULONG            ValidAccessMask;
    BOOLEAN          SecurityRequired;
    BOOLEAN          MaintainHandleCount;
    UCHAR            TypeIndex;
    CHAR             ReservedByte;
    ULONG            PoolType;
    ULONG            DefaultPagedPoolCharge;
    ULONG            DefaultNonPagedPoolCharge;
} OBJECT_TYPE_INFORMATION32;

78 79 80 81 82 83
typedef struct
{
    UNICODE_STRING32 ObjectName;
    UNICODE_STRING32 ObjectTypeName;
} DIRECTORY_BASIC_INFORMATION32;

84 85 86 87 88 89
typedef struct
{
    ULONG CompletionPort;
    ULONG CompletionKey;
} FILE_COMPLETION_INFORMATION32;

90 91 92 93 94 95 96
typedef struct
{
    ULONG             CompletionKey;
    ULONG             CompletionValue;
    IO_STATUS_BLOCK32 IoStatusBlock;
} FILE_IO_COMPLETION_INFORMATION32;

97 98 99 100 101 102 103 104
typedef struct
{
    BOOLEAN ReplaceIfExists;
    ULONG   RootDirectory;
    ULONG   FileNameLength;
    WCHAR   FileName[1];
} FILE_RENAME_INFORMATION32;

105 106 107 108 109 110 111
typedef struct
{
    ULONG Mask;
    WORD  Group;
    WORD  Reserved[3];
} GROUP_AFFINITY32;

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
typedef struct
{
    DWORD NumberOfAssignedProcesses;
    DWORD NumberOfProcessIdsInList;
    ULONG ProcessIdList[1];
} JOBOBJECT_BASIC_PROCESS_ID_LIST32;

typedef struct
{
    LARGE_INTEGER PerProcessUserTimeLimit;
    LARGE_INTEGER PerJobUserTimeLimit;
    DWORD         LimitFlags;
    ULONG         MinimumWorkingSetSize;
    ULONG         MaximumWorkingSetSize;
    DWORD         ActiveProcessLimit;
    ULONG         Affinity;
    DWORD         PriorityClass;
    DWORD         SchedulingClass;
} JOBOBJECT_BASIC_LIMIT_INFORMATION32;

typedef struct
{
    JOBOBJECT_BASIC_LIMIT_INFORMATION32 BasicLimitInformation;
    IO_COUNTERS                         IoInfo;
    ULONG                               ProcessMemoryLimit;
    ULONG                               JobMemoryLimit;
    ULONG                               PeakProcessMemoryUsed;
    ULONG                               PeakJobMemoryUsed;
} JOBOBJECT_EXTENDED_LIMIT_INFORMATION32;

typedef struct
{
    ULONG CompletionKey;
    LONG  CompletionPort;
} JOBOBJECT_ASSOCIATE_COMPLETION_PORT32;

148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
typedef struct
{
    ULONG    BaseAddress;
    ULONG    AllocationBase;
    DWORD    AllocationProtect;
    ULONG    RegionSize;
    DWORD    State;
    DWORD    Protect;
    DWORD    Type;
} MEMORY_BASIC_INFORMATION32;

typedef struct
{
    UNICODE_STRING32 SectionFileName;
} MEMORY_SECTION_NAME32;

typedef union
{
    ULONG Flags;
    struct {
        ULONG Valid : 1;
        ULONG ShareCount : 3;
        ULONG Win32Protection : 11;
        ULONG Shared : 1;
        ULONG Node : 6;
        ULONG Locked : 1;
        ULONG LargePage : 1;
    };
} MEMORY_WORKING_SET_EX_BLOCK32;

typedef struct
{
    ULONG                         VirtualAddress;
    MEMORY_WORKING_SET_EX_BLOCK32 VirtualAttributes;
} MEMORY_WORKING_SET_EX_INFORMATION32;

184 185 186 187 188 189 190 191 192 193
typedef struct
{
    NTSTATUS  ExitStatus;
    ULONG     PebBaseAddress;
    ULONG     AffinityMask;
    LONG      BasePriority;
    ULONG     UniqueProcessId;
    ULONG     InheritedFromUniqueProcessId;
} PROCESS_BASIC_INFORMATION32;

194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
typedef struct
{
    ULONG Version;
    ULONG Reserved;
    ULONG Callback;
} PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION32;

typedef struct
{
    ULONG ReserveSize;
    ULONG ZeroBits;
    ULONG StackBase;
} PROCESS_STACK_ALLOCATION_INFORMATION32;

typedef struct
{
    ULONG                                  PreferredNode;
    ULONG                                  Reserved0;
    ULONG                                  Reserved1;
    ULONG                                  Reserved2;
    PROCESS_STACK_ALLOCATION_INFORMATION32 AllocInfo;
} PROCESS_STACK_ALLOCATION_INFORMATION_EX32;

217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
typedef struct
{
    ULONG Size;
    PS_CREATE_STATE State;
    union
    {
        struct
        {
            ULONG InitFlags;
            ACCESS_MASK AdditionalFileAccess;
        } InitState;
        struct
        {
            ULONG FileHandle;
        } FailSection;
        struct
        {
            USHORT DllCharacteristics;
        } ExeFormat;
        struct
        {
            ULONG IFEOKey;
        } ExeName;
        struct
        {
            ULONG OutputFlags;
            ULONG FileHandle;
            ULONG SectionHandle;
            ULONGLONG UserProcessParametersNative;
            ULONG UserProcessParametersWow64;
            ULONG CurrentParameterFlags;
            ULONGLONG PebAddressNative;
            ULONG PebAddressWow64;
            ULONGLONG ManifestAddress;
            ULONG ManifestSize;
        } SuccessState;
    };
} PS_CREATE_INFO32;

typedef struct
{
    ULONG Attribute;
    ULONG Size;
    ULONG Value;
    ULONG ReturnLength;
} PS_ATTRIBUTE32;

typedef struct
{
    ULONG TotalLength;
    PS_ATTRIBUTE32 Attributes[1];
} PS_ATTRIBUTE_LIST32;

270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
typedef struct
{
    ULONG  Section;
    ULONG  MappedBaseAddress;
    ULONG  ImageBaseAddress;
    ULONG  ImageSize;
    ULONG  Flags;
    USHORT LoadOrderIndex;
    USHORT InitOrderIndex;
    USHORT LoadCount;
    USHORT NameOffset;
    BYTE   Name[MAXIMUM_FILENAME_LENGTH];
} RTL_PROCESS_MODULE_INFORMATION32;

typedef struct
{
    ULONG                            ModulesCount;
    RTL_PROCESS_MODULE_INFORMATION32 Modules[1];
} RTL_PROCESS_MODULES32;

typedef struct
{
    USHORT                           NextOffset;
    RTL_PROCESS_MODULE_INFORMATION32 BaseInfo;
    ULONG                            ImageCheckSum;
    ULONG                            TimeDateStamp;
    ULONG                            DefaultBase;
} RTL_PROCESS_MODULE_INFORMATION_EX32;

299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
typedef struct
{
    ULONG         BaseAddress;
    ULONG         Attributes;
    LARGE_INTEGER Size;
} SECTION_BASIC_INFORMATION32;

typedef struct
{
    ULONG   TransferAddress;
    ULONG   ZeroBits;
    ULONG   MaximumStackSize;
    ULONG   CommittedStackSize;
    ULONG   SubSystemType;
    USHORT  MinorSubsystemVersion;
    USHORT  MajorSubsystemVersion;
    USHORT  MajorOperatingSystemVersion;
    USHORT  MinorOperatingSystemVersion;
    USHORT  ImageCharacteristics;
    USHORT  DllCharacteristics;
    USHORT  Machine;
    BOOLEAN ImageContainsCode;
    UCHAR   ImageFlags;
    ULONG   LoaderFlags;
    ULONG   ImageFileSize;
    ULONG   CheckSum;
} SECTION_IMAGE_INFORMATION32;

327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
typedef struct
{
    ULONG Sid;
    DWORD Attributes;
} SID_AND_ATTRIBUTES32;

typedef struct
{
    ULONG DefaultDacl;
} TOKEN_DEFAULT_DACL32;

typedef struct
{
    DWORD                GroupCount;
    SID_AND_ATTRIBUTES32 Groups[1];
} TOKEN_GROUPS32;

typedef struct
{
    ULONG Owner;
} TOKEN_OWNER32;

typedef struct
{
    SID_AND_ATTRIBUTES32 User;
} TOKEN_USER32;

354 355 356 357 358 359 360 361 362 363 364 365
typedef struct
{
    NTSTATUS    ExitStatus;
    ULONG       TebBaseAddress;
    CLIENT_ID32 ClientId;
    ULONG       AffinityMask;
    LONG        Priority;
    LONG        BasePriority;
} THREAD_BASIC_INFORMATION32;

typedef struct
{
366 367
    UNICODE_STRING32 ThreadName;
} THREAD_NAME_INFORMATION32;
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399

typedef struct
{
    ULONG PeakVirtualSize;
    ULONG VirtualSize;
    ULONG PageFaultCount;
    ULONG PeakWorkingSetSize;
    ULONG WorkingSetSize;
    ULONG QuotaPeakPagedPoolUsage;
    ULONG QuotaPagedPoolUsage;
    ULONG QuotaPeakNonPagedPoolUsage;
    ULONG QuotaNonPagedPoolUsage;
    ULONG PagefileUsage;
    ULONG PeakPagefileUsage;
} VM_COUNTERS32;

typedef struct
{
    ULONG PeakVirtualSize;
    ULONG VirtualSize;
    ULONG PageFaultCount;
    ULONG PeakWorkingSetSize;
    ULONG WorkingSetSize;
    ULONG QuotaPeakPagedPoolUsage;
    ULONG QuotaPagedPoolUsage;
    ULONG QuotaPeakNonPagedPoolUsage;
    ULONG QuotaNonPagedPoolUsage;
    ULONG PagefileUsage;
    ULONG PeakPagefileUsage;
    ULONG PrivateUsage;
} VM_COUNTERS_EX32;

400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
typedef struct
{
    DBG_STATE   NewState;
    CLIENT_ID32 AppClientId;
    union
    {
        struct
        {
            EXCEPTION_RECORD32 ExceptionRecord;
            ULONG FirstChance;
        } Exception;
        struct
        {
            ULONG HandleToThread;
            struct
            {
                ULONG SubSystemKey;
                ULONG StartAddress;
            } NewThread;
        } CreateThread;
        struct
        {
            ULONG HandleToProcess;
            ULONG HandleToThread;
            struct
            {
                ULONG SubSystemKey;
                ULONG FileHandle;
                ULONG BaseOfImage;
                ULONG DebugInfoFileOffset;
                ULONG DebugInfoSize;
                struct
                {
                    ULONG SubSystemKey;
                    ULONG StartAddress;
                } InitialThread;
            } NewProcess;
        } CreateProcessInfo;
        struct
        {
            NTSTATUS ExitStatus;
        } ExitProcess, ExitThread;
        struct
        {
            ULONG FileHandle;
            ULONG BaseOfDll;
            ULONG DebugInfoFileOffset;
            ULONG DebugInfoSize;
            ULONG NamePointer;
        } LoadDll;
        struct
        {
            ULONG BaseAddress;
        } UnloadDll;
    } StateInfo;
} DBGUI_WAIT_STATE_CHANGE32;

457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
typedef struct
{
    ULONG unknown;
    ULONG KeMaximumIncrement;
    ULONG PageSize;
    ULONG MmNumberOfPhysicalPages;
    ULONG MmLowestPhysicalPage;
    ULONG MmHighestPhysicalPage;
    ULONG AllocationGranularity;
    ULONG LowestUserAddress;
    ULONG HighestUserAddress;
    ULONG ActiveProcessorsAffinityMask;
    BYTE  NumberOfProcessors;
} SYSTEM_BASIC_INFORMATION32;

typedef struct
{
    ULONG CurrentSize;
    ULONG PeakSize;
    ULONG PageFaultCount;
    ULONG MinimumWorkingSet;
    ULONG MaximumWorkingSet;
    ULONG CurrentSizeIncludingTransitionInPages;
    ULONG PeakSizeIncludingTransitionInPages;
    ULONG TransitionRePurposeCount;
    ULONG Flags;
} SYSTEM_CACHE_INFORMATION32;

typedef struct
{
    ULONG  OwnerPid;
    BYTE   ObjectType;
    BYTE   HandleFlags;
    USHORT HandleValue;
    ULONG  ObjectPointer;
    ULONG  AccessMask;
} SYSTEM_HANDLE_ENTRY32;

typedef struct
{
    ULONG                 Count;
    SYSTEM_HANDLE_ENTRY32 Handle[1];
} SYSTEM_HANDLE_INFORMATION32;

typedef struct
{
    ULONG RegistryQuotaAllowed;
    ULONG RegistryQuotaUsed;
    ULONG Reserved1;
} SYSTEM_REGISTRY_QUOTA_INFORMATION32;

typedef struct
{
    ULONG  Object;
    ULONG  UniqueProcessId;
    ULONG  HandleValue;
    ULONG  GrantedAccess;
    USHORT CreatorBackTraceIndex;
    USHORT ObjectTypeIndex;
    ULONG  HandleAttributes;
    ULONG  Reserved;
} SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX32;

typedef struct
{
    ULONG  NumberOfHandles;
    ULONG  Reserved;
    SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX32 Handles[1];
} SYSTEM_HANDLE_INFORMATION_EX32;

typedef struct
{
    ULONG ProcessorMask;
    LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
    union
    {
        struct
        {
            BYTE Flags;
        } ProcessorCore;
        struct
        {
            DWORD NodeNumber;
        } NumaNode;
        CACHE_DESCRIPTOR Cache;
        ULONGLONG Reserved[2];
    };
} SYSTEM_LOGICAL_PROCESSOR_INFORMATION32;

typedef struct
{
    BYTE Flags;
    BYTE EfficiencyClass;
    BYTE Reserved[20];
    WORD GroupCount;
    GROUP_AFFINITY32 GroupMask[ANYSIZE_ARRAY];
} PROCESSOR_RELATIONSHIP32;

typedef struct
{
    DWORD NodeNumber;
    BYTE Reserved[20];
    GROUP_AFFINITY32 GroupMask;
} NUMA_NODE_RELATIONSHIP32;

typedef struct
{
    BYTE Level;
    BYTE Associativity;
    WORD LineSize;
    DWORD CacheSize;
    PROCESSOR_CACHE_TYPE Type;
    BYTE Reserved[20];
    GROUP_AFFINITY32 GroupMask;
} CACHE_RELATIONSHIP32;

typedef struct
{
    BYTE MaximumProcessorCount;
    BYTE ActiveProcessorCount;
    BYTE Reserved[38];
    ULONG ActiveProcessorMask;
} PROCESSOR_GROUP_INFO32;

typedef struct
{
    WORD MaximumGroupCount;
    WORD ActiveGroupCount;
    BYTE Reserved[20];
    PROCESSOR_GROUP_INFO32 GroupInfo[ANYSIZE_ARRAY];
} GROUP_RELATIONSHIP32;

typedef struct
{
    LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
    DWORD Size;
    union
    {
        PROCESSOR_RELATIONSHIP32 Processor;
        NUMA_NODE_RELATIONSHIP32 NumaNode;
        CACHE_RELATIONSHIP32 Cache;
        GROUP_RELATIONSHIP32 Group;
    };
} SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX32;

typedef struct
{
    LARGE_INTEGER KernelTime;
    LARGE_INTEGER UserTime;
    LARGE_INTEGER CreateTime;
    DWORD         dwTickCount;
    ULONG         StartAddress;
    CLIENT_ID32   ClientId;
    DWORD         dwCurrentPriority;
    DWORD         dwBasePriority;
    DWORD         dwContextSwitches;
    DWORD         dwThreadState;
    DWORD         dwWaitReason;
    DWORD         dwUnknown;
} SYSTEM_THREAD_INFORMATION32;

typedef struct
{
    ULONG            NextEntryOffset;
    DWORD            dwThreadCount;
622 623 624 625
    LARGE_INTEGER    WorkingSetPrivateSize;
    ULONG            HardFaultCount;
    ULONG            NumberOfThreadsHighWatermark;
    ULONGLONG        CycleTime;
626 627 628 629 630 631 632 633 634
    LARGE_INTEGER    CreationTime;
    LARGE_INTEGER    UserTime;
    LARGE_INTEGER    KernelTime;
    UNICODE_STRING32 ProcessName;
    DWORD            dwBasePriority;
    ULONG            UniqueProcessId;
    ULONG            ParentProcessId;
    ULONG            HandleCount;
    ULONG            SessionId;
635
    ULONG            UniqueProcessKey;
636 637 638 639 640
    VM_COUNTERS_EX32 vmCounters;
    IO_COUNTERS      ioCounters;
    SYSTEM_THREAD_INFORMATION32 ti[1];
} SYSTEM_PROCESS_INFORMATION32;

641 642 643 644 645 646 647 648 649 650 651 652
typedef struct
{
    SYSTEM_THREAD_INFORMATION32 ThreadInfo;
    ULONG                       StackBase;
    ULONG                       StackLimit;
    ULONG                       Win32StartAddress;
    ULONG                       TebBase;
    ULONG                       Reserved2;
    ULONG                       Reserved3;
    ULONG                       Reserved4;
} SYSTEM_EXTENDED_THREAD_INFORMATION32;

653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
struct __server_iovec32
{
    ULONG        ptr;
    data_size_t  size;
};

struct __server_request_info32
{
    union
    {
        union generic_request req;
        union generic_reply   reply;
    } u;
    unsigned int            data_count;
    ULONG                   reply_data;
    struct __server_iovec32 data[__SERVER_MAX_DATA];
};

671
#endif /* __WOW64_STRUCT32_H */