Commit graph

93 commits

Author SHA1 Message Date
Timo Kreuzer 719200874a Revert r46466 this time for real
svn path=/trunk/; revision=46493
2010-03-27 18:57:56 +00:00
Timo Kreuzer d0701d72b7 Reintegrate header branch
- DDKAPI -> NTAPI
- delete duplicate definitions
- move files to right locations
- Fix Mm64BitPhysicalAddress definition
- Add a number of missing definitions
- add XDK

svn path=/trunk/; revision=46466
2010-03-26 13:50:02 +00:00
Timo Kreuzer fb69e522da Merge from amd64-branch:
44501 (tkreuzer)
[NDK]
- Add CLIENT_ID32/64
- Create explicit 32/64 bit versions of PEB, GDI_TEB_BATCH and TEB, using macros.
- Fix some member names.


44503 (tkreuzer)
[CMD]
Fix a teb member name

44504 (tkreuzer)
[NTSOKRNL]
Fix a teb member name

44506 (tkreuzer)
[NDK]
fix a typo in the TEB definition

44511 (tkreuzer)
[NDK]
- Add Wx86ThreadState
- Add WinXP version of ACTIVATION_CONTEXT_STACK
- rtltypes doesn't depend on pstypes, but the opposite way around now

44512 (tkreuzer)
[NDK]
Fix some dependencies

44521 (tkreuzer)
[NTDKK]
- Don't use PEB::FastPeb(Un)LockRoutine, these members are deprecated since Windows 2003, use RtlEnter/LeaveCriticalSection instead.

44523 (tkreuzer)
[NTDLL]
Fix usage of PEB::KernelCallbacktable. It's a PVOID.

44524 (tkreuzer)
NDK]
- Add missing TEB member for Vista

44525 (tkreuzer)
[NDK]
Fix a TEB array size.

44526 (tkreuzer)
[USER32]
More fix of TEB::KernelCallbackTable usage

svn path=/trunk/; revision=46434
2010-03-25 12:22:59 +00:00
Timo Kreuzer 9ea495ba33 Create a branch for header work.
svn path=/branches/header-work/; revision=45691
2010-02-26 22:57:55 +00:00
Timo Kreuzer c5a2bbe739 [NDK]
- Add CLIENT_ID32/64
- Create explicit 32/64 bit versions of PEB, GDI_TEB_BATCH and TEB, using macros. Thanks to Alex for feedback and suggestions.
- Fix some member names.
- Note to self: fix rostests, too!

svn path=/branches/ros-amd64-bringup/; revision=44501
2009-12-10 00:35:12 +00:00
Timo Kreuzer c9514d7561 Fix merge artifact, spotted by encoded
svn path=/branches/ros-amd64-bringup/; revision=43835
2009-10-29 21:49:28 +00:00
Timo Kreuzer dfb17b5cd9 Merge trunk (r43561)
svn path=/branches/ros-amd64-bringup/; revision=43562
2009-10-18 17:24:21 +00:00
Timo Kreuzer 3458af75ee EPROCESS.Session is a PVOID not an ULONG
svn path=/branches/ros-amd64-bringup/; revision=43497
2009-10-15 19:55:06 +00:00
ReactOS Portable Systems Group 1ea8fff57a - Multiple PEB/TEB creation fixes:
- Set up PEB and TEB under SEH to handle possible paging errors (which are legitimate).
  - Also touch the image under SEH to handle image paging errors (also legitimate).
  - Should avoid kernel panics in cases where the executable is damaged, invalid, or impossible to page in.
  - Initialize more PEB fields.
  - Add new INITIAL_PEB structure to support fork() in the future. Also fixes the fact we don't create a PEB for the system process anymore.
  - Create PEB while attached to the process.
  - Handle UP-only images, and set correct affinity mask in the PEB.
  - Set session ID instead of session structure (currently zero).
  - Set correct TIB version in the TEB. Due to a historical oddity, the NT TIB identifies itself as '0x1e00', which is 30 shifted 8 bits. 30 is the version identifier of OS/2 3.0, the original 32-bit target of the Windows NT effort.
  - Handle initial TEB correctly for fork().
  - Move AWE APIs to procsup.c instea of section.c since they are unrelated.
  - Move the rewritten PEB/TEB functions to ARM3's procsup.c.

svn path=/trunk/; revision=43476
2009-10-15 05:56:41 +00:00
Timo Kreuzer af3f2d5454 Merge amd64 NDK from amd64 branch:
34711, 34712, 34842, 34925, 34967, 34970, 35323, 35324, 35347, 35348, 35361, 35436, 35509, 35588, 35739, 35823, 35952, 35966, 36360, 37323, 37434, 37472, 37536, 37820, 37821, 37869, 37990, 38013, 38014, 43426, 43454

svn path=/trunk/; revision=43455
2009-10-14 16:45:35 +00:00
Timo Kreuzer 250d69afc8 Sync to trunk head (r42241)
svn path=/branches/ros-amd64-bringup/; revision=42244
2009-07-26 23:21:27 +00:00
Aleksey Bragin 9152e0286c - Remove padding member from ETHREAD, it's not needed anymore after KTHREAD has been fixed.
svn path=/trunk/; revision=41545
2009-06-22 14:09:16 +00:00
Timo Kreuzer 4135e99ab6 Merge trunk head (r41474)
svn path=/branches/ros-amd64-bringup/; revision=41488
2009-06-20 13:45:51 +00:00
Dmitry Chapyshev 1b75d3dfa3 - Add job limit flags (based on MSDN info)
svn path=/trunk/; revision=41391
2009-06-12 15:49:16 +00:00
Timo Kreuzer e8109f52a0 revert 37475 and 37818
svn path=/branches/ros-amd64-bringup/; revision=37923
2008-12-08 07:32:09 +00:00
Timo Kreuzer d00a945f03 sync to trunk head (37853) (except rbuild changes)
This breaks everything. Sorry, but it has to be done.
Will fix ASAP.

svn path=/branches/ros-amd64-bringup/; revision=37867
2008-12-05 15:30:17 +00:00
Stefan Ginsberg 6d811e8712 - Get rid of DDK's dependency on windef.h and winnt.h
- Clean up, fix, and add missing types to ntdef.h/ntifs.h/winddk.h/wdm.h/ntpoapi.h
- Add ntimage.h and use it in rossym and NDK
- Fix a gcc compatibility issue -- some internal NT structures have their pointer types defined in the DDK headers, but we define them along with the "struct" type when defining the full structure. MSVC is okay with this double definition, but gcc treats it as an error (hidden by system_header). Only define the "struct" type when declaring the full structure, making it compatible with both compilers.
- Also fix/add some types and header guards in NDK
- Clean up ks/portcls/drmk headers
- Fix incorrect types for some KS APIs (msdn is wrong for these) and add missing header guards
- Also, remove system_header (more of this coming up)

svn path=/trunk/; revision=37792
2008-12-01 15:12:23 +00:00
Timo Kreuzer e7b4c29057 EPROCESS.Session should be a HANDLE.
svn path=/branches/ros-amd64-bringup/; revision=37475
2008-11-19 22:28:26 +00:00
Timo Kreuzer ca24ca153b ETHREAD.TopLevelIrp is ULONG_PTR, not ULONG
svn path=/branches/ros-amd64-bringup/; revision=37434
2008-11-18 03:01:31 +00:00
Timo Kreuzer 016e911156 merge 35359 from ros-amd64-bringup branch:
The TEB member is called ClientId not Cid on all Windows versions I could check (XP, 2k3, vista).

svn path=/trunk/; revision=35631
2008-08-25 16:38:02 +00:00
Timo Kreuzer bb78749234 The TEB member is called ClientID not Cid on all Windows versions I could check (XP, 2k3, vista).
svn path=/branches/ros-amd64-bringup/; revision=35359
2008-08-15 23:40:42 +00:00
Timo Kreuzer ed1b845158 NDK: update PEB definition based in win2003 and vista 32/64 bit symbols
svn path=/branches/ros-amd64-bringup/; revision=35349
2008-08-15 02:05:18 +00:00
Aleksey Bragin 9655f89744 - Don't strictly check NTDDI_VERSION to WINXP or WS03, since in case of e.g. NTDDI_WS03SP1 the define would work incorrectly (skipping a structure member).
svn path=/trunk/; revision=34914
2008-07-28 18:38:11 +00:00
Aleksey Bragin 0cac013600 - NDK fix: ImageUsesLargePages in PEB appeared in Windows 2003 already (confirmed with SP1 though).
svn path=/trunk/; revision=34134
2008-06-27 17:26:10 +00:00
Aleksey Bragin 43695ec25d - NDK fixes.
svn path=/trunk/; revision=34124
2008-06-27 08:23:45 +00:00
Aleksey Bragin 89d35e62dd - More NDK fixes.
- Hackmove: Define NTDDI_VERSION in kernel32, otherwise it gets derived from WINVER version (and thus kernel32 becomes Vista). This allows to remove #undef NTDDI_VERSION from ndk/obtypes.h.

svn path=/trunk/; revision=33990
2008-06-16 09:20:47 +00:00
ReactOS Portable Systems Group 57ad1f5f20 Add basic arm target support to the build system.
Reactos-arm.rbuild uses the same settings as the x86 version, but defines _ARM_ and __arm__ instead. _M_ARM is already defined by the compiler.
Add ARM system call stub support to ncitool. We are currently using a SWI 0x2E to achieve this.
Add ARM support to winnt.h.
Add a preliminary intrin_arm.h
Add ketypes.h and mmtypes.h for ARM in the NDK. For now these are mostly stubs to allow compiling to work.
Add ARM support to winddk.h.
Fix some broken x86-only assumptions in the NDK.
Add config-arm-template.rbuild. By defauilt we build for armv5te (armv4 and v5 are supported, not v6).
Set ROS_ARCH=arm to switch to ARM. Set ROS_PREFIX to an appropriate MinGW-32 ARM PE crosscompiler.


svn path=/trunk/; revision=32131
2008-02-05 02:58:28 +00:00
James Tabor b45ddf2209 Fix gdi init so it can support batch. Used wrong limit source.
svn path=/trunk/; revision=29993
2007-10-31 02:48:54 +00:00
Mike Nordell 1f2fce4fea [COMMENT] Document array indices for EPROCESS.Quota* members.
svn path=/trunk/; revision=29771
2007-10-22 10:04:52 +00:00
Daniel Reimer ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Aleksey Bragin 8f33e033e4 - Add missing KERNEL_LARGE_STACK_COMMIT definition to DDK.
- Fix typo in MMWSL.
- Add RtlRandom to NDK.
- Add MEMORY_PRIORITY values to NDK.
- Add KeAcquireSpinLockRaiseToSynch to NDK.
- Make MmInitializeProcessAddressSpace take two more parameters: one to specify flags, such as large page support, and another one to define the process being cloned, when fork() support will be added.
- Add KeInvalidAccessAllowed to deal with page faults in the special S-List code. The assembly code currently handles simple faults, but our MmAccessFault handler needs to start verifying the fault too.
- Mark LoaderReserve pages as LoaderFree, it seems they end up this way in Windows.
- Use MmNumberOfPhysicalPages instead of MmStats.NrTotalPages.

All NDK changes are discussed with Alex.

svn path=/trunk/; revision=29254
2007-09-27 18:07:44 +00:00
Aleksey Bragin 2c239e0bd6 - PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.

Thanks to Alex for providing various information, and answering all my questions.

svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
Aleksey Bragin 432625614e - Implement InterlockedExchangeAdd/Decrement/Increment16.
- Fix MM_EXTEND_INFO definition.
- Fix MMWSLE definition.
- Fix EPROCESS definition.
- Add quota functions to NDK.
- Add one more parameter to PspMapSystemDll to support mapping large pages.
- Don't make the quota functions do anything for the system process.
- Add page file quota functions.
- Other misc small fixes.

svn path=/trunk/; revision=29214
2007-09-26 16:41:35 +00:00
Aleksey Bragin 2cbc032859 - Add Ex*Spinlock macros and FLUSH_MULTIPLE_MAXIMUM definitions missing from DDK
- Add KeAcquireQueuedSpinLock / KeAcquireReleaseQueuedSpinLock, RtlCompareMemoryUlong definitions missing from IFS.
- Add actual section object definition to NDK
- More NDK fixes
- Fix incorrect definition of MMPTE_LIST
- Fix incorrect prototype of NtFlushVirtualMemory
- Fix incorrect prototypes of KeAcquire / ReleaseQueuedSpinLock
- Add a second parameter to MmCreateKernelStack to select the NUMA node on which the stack should be allocated
- Avoid usage of PROS_SECTION_OBJECT in Ps where possible
- Unimplement PsChargeProcessQuota. It was not working right
- Use PFN_NUMBER defined in DDK instead of PFN_TYPE internal ROS Type.

svn path=/trunk/; revision=29188
2007-09-24 14:01:54 +00:00
Aleksey Bragin ab5811a512 - Move W32CLTINFO_TEB structure out of NDK, since it's module-internal structure.
- Add a define for easier accessing this field.

svn path=/trunk/; revision=29069
2007-09-16 17:37:41 +00:00
James Tabor d5de37fdd3 Fix typo, add extra entry to the structure.
svn path=/trunk/; revision=29028
2007-09-14 05:05:35 +00:00
James Tabor 1c35130224 Add window client information structure to TEB.
svn path=/trunk/; revision=29026
2007-09-13 16:57:53 +00:00
Aleksey Bragin ac4295e788 - WDK and MSVC compatibility fixes.
svn path=/trunk/; revision=28151
2007-08-04 08:26:58 +00:00
Alex Ionescu 2d88738681 - NDK updates and compatibility fixes for Vista/WDK/User-Mode/Individual per-file NDK Usage.
- Update targets to pentium to take advantage of cmpxhg8b when possible. (ROS won't run on 386/486 anyway).
- Fix some compiler problems when building with -O3.

svn path=/trunk/; revision=26274
2007-04-07 05:33:30 +00:00
Sylvain Petreolle 61ea6949b7 fix build
svn path=/trunk/; revision=25964
2007-03-02 22:04:21 +00:00
Alex Ionescu f5751896c4 -Fix build
svn path=/trunk/; revision=25958
2007-03-02 20:40:48 +00:00
Alex Ionescu 9efff39376 - Fix multiple WDK compatibilities issues.
- Fix MSVC warnings and incompatibilities.

svn path=/trunk/; revision=25947
2007-03-02 16:26:45 +00:00
Hervé Poussineau f9b6e910f9 Better support for non X86 systems
svn path=/trunk/; revision=25264
2007-01-01 14:50:16 +00:00
Alex Ionescu 312f07d0e5 - Major changes to HAL/kernel loading and freeldr hacks:
- Add PE routines for traversing the import table and fixing up the imports.
  - Add routine for getting the LOADER_MODULE for a freeldr module by name.
  - Add the ability to load a not-yet-loaded-driver that's in an import entry (ie: dependencies). Only used for HAL now.
  - Map HAL in the same was as the kernel, instead of relocating it as a hack from within the kernel.
  - Refactor some routines to better share code. Don't read freed memory anymore.
  - Use LdrRelocateImageWithBias instead of quintuplicating relocation code.
  - Parse kernel and HAL imports while PE-loading from within freeldr.
  - Remove dozens of freeldr.c hacks from the kernel. Remove slow code which was making two copies of the parameter block and wasting over 30KB in static strings that were immediately copied to other strings...
  - Don't use HalModuleObject and NtoskrnlModuleObject anymore. Remove LdrSafePEProcessModule and other similar boot-time hacks. Reimplement MmGetSystemRoutineAddress.
- NDK/DDK fixes.
- Add KDCOM to bootcd/installation.

svn path=/trunk/; revision=24778
2006-11-19 17:53:31 +00:00
Alex Ionescu b5e25167e2 - Move all ASM internal intrinsics to intrin_i.h. Request for KJK::Hyperion/hackbunny to look at the GCC ones and optimize/fix them up.
- Add MSVC versions for some of them (not yet complete).
- Fix the fact that KeGetLocalDescriptorTable was setting the LDT instead of retrieving it.
- Fix bug in LIST_FOR_EACH and LIST_FOR_EACH_SAFE which was setting the flink to NULL instead of checking if the flink is NULL. One more reason these damned macros should've never been used.
- Use MSVC-intrinsics when applicable (_disable/_enable, etc).
- Fix JOB_SET_ARRAY problems.
- Fix buffer overflow in SystemProcessInformation QSI_DEF.
- Fix some broken compares/arithmetic to due to lack of parens.
- Add some ASSERTS to some unknown functions that make pointer assumptions.

svn path=/trunk/; revision=24650
2006-10-25 16:37:46 +00:00
Alex Ionescu 254f6b62ac - More MSVC fixes (down to 19 errors):
- Header changes: fix FILE_LOCK_INFO, LARGE_MCB, BASE_MCB, MM_SYSTEMSIZE.
- Remove many things in W32API which are incorrectly there (due to winnt being used by the win32api DDK). Defined them in the NDK instead, where appropriate (mostly definitions that are present in user-mode headers, but not kernel-mode headers).
- Hacked the ERESOURCE functions to define a special ERESOURCE_XP type. This is necessary because ERESOURCE is an opaque-yet-exported structure, and its structure changed in Vista.
- Removed support for IMAGE_SCN_TYPE_NO_LOAD. It is a reserved field and Windows does not "respect" it. (sections marked as no-load will still be loaded by NT).

svn path=/trunk/; revision=23972
2006-09-07 21:36:15 +00:00
Alex Ionescu 90ea51a96b - ImperstionationLocale -> ImpersonationLocale.
- Implement PspWriteTebImpersonationInfo for setting the impersonation locale and impersonation status in the TEB (since User-mode needs to read this value and we don't want to NtQueryInformationThread for it each time to read the ETHERAD flag).
- Complete the implementation of PspSetPrimaryToken to recalculate a process's access rights to itself based on a new primary token.
- Reorganize ps.h header like ob.h and io.h, implement Tracing support but not the tracing itself yet.
- Get rid of some deprecated cruft.

svn path=/trunk/; revision=23233
2006-07-23 05:43:28 +00:00
Alex Ionescu 59c6a927a2 - CT_ACTIVE_IMPERSTIONATION_INFO_BIT -> CT_ACTIVE_IMPERSONATION_INFO_BIT
- Added Process and Thread locking inlined functions for Ps Security functions.
- Thread safety is your friend! Huge rework of almost all the functions in ps/security.c to use the process/thread pushlocks and use interlocked operations when dealing with the ActiveImpersonationInfo thread flag.
- Added PAGED_CODE().
- Added checks for Processes with Jobs for the day that will happen.
- PsAssignImpersoonationToken with a NULL token handle means simply to revert to self.
- Don't ignore the HandleAttributes in NtOpenProcessTokenEx.
- Use SeTokenType to make sure the token passed is an impersonation token.
- Remove some fixed bugs in krnlfun.c, add more TODOs.

svn path=/trunk/; revision=23231
2006-07-22 22:57:42 +00:00
Alex Ionescu 2f2139d851 - Implement Kernel, Memory Manager and Process Manager APIs for the following concepts (not yet used):
- Process Quantum.
  - Fixed and Variable Quantum Tables.
  - Long and Short Quantum Variability.
  - Priority Separation and Separation Masks.
  - Foreground Quantum Table.
  - Process Priority, Priority Modes and Priority Classes.
  - Virtual Memory Priority
  - Job Scheduling Classes
- Implement PsSetProcessPriorityByClass.

svn path=/trunk/; revision=23214
2006-07-21 19:28:38 +00:00
Alex Ionescu a92681004e - Move a bunch of externs to ps.h and delete many dupped/tripped ones.
- Change FAST_MUTEX PsActiveProcessMutex to KGUARDED_MUTEX.
- Define PS Flags and use them, isntead of magic numbers. (For magic mushrooms, you'll have to wait a while, these aren't implemented yet).

svn path=/trunk/; revision=23194
2006-07-20 16:26:10 +00:00