- PspAssignPrimaryToken was good enough for actually *assigning* the token, but when NtSetInfoProcess is called with ProcessPrimaryToken, we want to do a lot more then just randomly assigning it. Added PspSetPrimaryToken which first verifies if the token being assigned is a child token and if not, checks for SeAssignPrimaryTokenPrivilege. Also added a fixme for more code that's needed, to actually re-calculate the process's granted access towards itself. Also added thread-safety.
svn path=/trunk/; revision=23226
-Win32k and User32
- Menu.c: Made set menu items selective masking. Setting masks fixed the garbage going into the item structure. Now right justify menu bar works. There are some more cosmetic issues left to do. I have those ready next week or so. Running wine menu test fail due to exception in kernel32 IsBadStringPtrA&W isbad.c. Funny? Does PSEH work in user mode? The string test is needed. Misc fixed, some restructuring and Wine ports. Please let me know if it breaks something.
svn path=/trunk/; revision=23221
- Implement NtSuspend/ResumeProcess with PsSuspend/ResumeProcess.
- Improve the previous code to use rundown protection and be thread-safe.
svn path=/trunk/; revision=23198
- Remove a bunch of deprecated crap from ps.h
- Get rid of PsLockProcess, PsUnlockProcess. Use the process pushlock instead.
- When assigning the job, only acquiring rundown protection is enough.
- Use interlocked intrinsics for setting the ExceptionPort instead of locking the entire process object.
- Disable locking in ProcessSessionInformation for NtSetInformationProcess. The whole API seems wrong anyway, on my XP machine calling it does not change the session or change any token data. To verify later...
svn path=/trunk/; revision=23197
The graphics, mouse and keyboard are virtually done. Mouse wheel works. Still some bugs in the handling of binary raster operation codes, but less than before. Fixed polyline. Fixed all cursor issues. Fully supports text output. Fixed a resource leak where all clipping region were slowly leaked. Now closes cleanly on server disconnect
Moving on to more fun things!
Many thanks to filip & WaxDragon for the code of the previous Win32 port, it was misleading at times but very useful overall!
svn path=/trunk/; revision=23196
[AUDIT]
- Most of the functions are documented at length in Windows Internals II and at a more high-level fashion in Windows Internals 4 and were based on that information. Undocumented routines were based of the operations done in the documented ones (for example, freeing buffers that we know were allocated, etc).
svn path=/trunk/; revision=23195
- 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
- Reformat and annotate parts of process.c
- Remove PsGetWin32Process, PsGetWin32Thread and implement/export the real functions PsGetCurrentProcessWin32Process, PsGetCurrentThreadWin32Thread, change win32k to use them.
- Initailize and use process rundown.
- Set corrent GrantedAccess.
- Remove an extra incorrect reference we were adding to processes.
- Implement PsIsProcessBeingDebugged.
- Make the same changes to NtOpenProcess that we did previously to NtOpenThread.
svn path=/trunk/; revision=23192
1. DD_CALLBACKS code writen by me have been move to dd.c
2. follow DD_CALLBACKS api is working as they should
NtGdiDdWaitForVerticalBlank, NtGdiDdCanCreateSurface, NtGdiDdGetScanLine
3. follow api does not working as it should, is it gdi32 problem or win32k problem for it ?
NtGdiDdCreateSurface
4. Start rewriten surf callback and cleanup some code
alot wrong with them.
5. start moving surface callback to ddsurf.c
svn path=/trunk/; revision=23189
- 90% of the functions in this file are 1 line functions which set or get a value from ETHREAD.
- The other 4 functions are related to User and System Thread Startup APCs, which are documented in gruesome detail and pseudo-code in Windows Internals 4 and Windows Internals II, as well as the main Thread Creation routine (PspCreateThread) which is one of the most well documented internal routines of NT. Code was developped in conjuction with WI4 and WI II.
svn path=/trunk/; revision=23180
- Organize thread.c into private/public functions properly.
- Do another pass of formatting fixes and function annotation.
- Fix a bug in PspSystemStartup.
- Properly hold object references towards a thread that's being created.
- Set the Thread->GrantedAccess value.
- Update NtOpenThread to use an Access State since these work now and Ob respects them, and also add a special hack present on NT: If the SeDEbugPrivilege is present, then the caller will get full thread access regardless of his rights.
svn path=/trunk/; revision=23179
- PspGetImagePath: internal to ROS and reads the image path pretty differently from how NT does it.
- NtQuery/Set functions: although huge in size, they are just a set of 2-10 line sub-functions which only transfer data from EPROCESS into a usermode structure or vice-versa. Fully documented in Nebett's book, and we have many test cases in the tree which show their clean implementation.
- Also, our nice automatgic buffer validation and size checks are 100% Thomas's genius and not used in NT at all.
- Thus, file is clean.
svn path=/trunk/; revision=23177