Commit graph

24042 commits

Author SHA1 Message Date
Alex Ionescu 4f9ab3b9a5 - Add a new member to MM_IMAGE_SECTION_OBJECT to hold the size of the mapped image file.
- Finally load driver images like human beings, as actual image section objects instead of random memory that we allocate and manually "load" using unsafe and crappy PE memory copies. We now use KJK's integer-safe and properly documented/implemented loader for image sections that is already used for processes and other user-mode images.
- Implement MiLoadImageSection for the task above and remove all the deprecated code that did the previous hackloading.

svn path=/trunk/; revision=25891
2007-02-23 15:31:45 +00:00
Saveliy Tretiakov 0446badad8 Move primary language selection from Input Locale page to General page.
svn path=/trunk/; revision=25890
2007-02-23 09:35:32 +00:00
Saveliy Tretiakov 82acba718f Update testapp
svn path=/trunk/; revision=25889
2007-02-23 08:56:32 +00:00
Saveliy Tretiakov e67ae3715b Add KLF_SHIFTLOCK and KLF_RESET
svn path=/trunk/; revision=25888
2007-02-23 08:21:29 +00:00
Saveliy Tretiakov 8daaec74a8 Fix warnings.
svn path=/trunk/; revision=25887
2007-02-23 08:20:33 +00:00
Alex Ionescu 8648ea02e1 - Get rid of LdrGetModuleObject, since MmLoadSystemImage will now return the existing module object in case it has already been loaded, get rid of LdrGetProcedureAddress, it doesn't belong in the kernel. Move MmGetSystemRoutineAddress from mm.c to sysldr.c and rewrite it to use MiFindExportedRoutineByName instead.
- Remove /ldr ntoskrnl directory, since this module is finally gone.
- Make PsInit code search for ntdll lookups using LookupEntryPoint internal function, instead of LdrGetProcedureAddress. Same code but done with recursion instead, and internal to this module (remove ANSI_STRINGs since we don't need them anymore).

svn path=/trunk/; revision=25886
2007-02-23 07:56:01 +00:00
Alex Ionescu 86c4790af3 - Merge DbgUnLoadImageSymbols from KD branch.
- Rename LdrUnloadModule to MmUnloadSystemImage and:
  - Use MmSystemLoadLock.
  - Take into consideration the import list.
  - Honour load count.
  - Unload symbols if really unloading the image.
  - Dereference and clear imports.
  - Do proper LdrEntry cleanup.
- Stub MiDereferenceImports and MmCallDllInitialize.
- Implement MiLocateExportName and MiClearImports.
- We don't yet fully support reference counting imports...this is still TBD.

svn path=/trunk/; revision=25885
2007-02-23 07:13:19 +00:00
Alex Ionescu bae0317c7c - Fix build.
svn path=/trunk/; revision=25884
2007-02-23 06:59:10 +00:00
Alex Ionescu 3111dda705 - Fix MmCreateImageSection to use previous mode instead of hardcoding UserMode.
- Implement MiProcessLoaderEntry for adding/removing entries on the PsLoadedModuleList.
- Move MmLoadSystemImage from loader.c to sysldr.c
- Update MmLoadSystemImage:
  - Use MmSystemLoadLock.
  - Support returning the entry for an already-loaded image, instead of loading it twice.
  - Use Section APIs to map the image... we're still doing a dirty ZwReadFile hack, but at least now we can depend on the PE code to validate the image (so removed the hardcoded validation).
  - Add more generic cleanup got so we can just jump to it.
  - Add more stub code and detection code for upcoming features.

svn path=/trunk/; revision=25883
2007-02-23 05:39:42 +00:00
Dmitry Gorbachev 736a4de31f Indonesian translation by Zaenal Mutaqin (ade999 at gmail dot com)
svn path=/trunk/; revision=25882
2007-02-23 01:42:52 +00:00
Alex Ionescu e81f8006bb - Move some Mm routines from pe.c to sysldr.c where they belong.
- Create and initialize Mm Loader lock.
- Re-arrange some code in MmLoadSystemImage, no code changes yet.
- Add new LDRP_ flags for LDR_DATA_TABLE_ENTRY to the NDK.

svn path=/trunk/; revision=25881
2007-02-22 20:55:02 +00:00
Saveliy Tretiakov 50b11bc313 Handle WM_INPUTLANGCHANGE and WM_INPUTLANGCHANGEREQUEST in DefWindowProc.
svn path=/trunk/; revision=25880
2007-02-22 19:43:27 +00:00
Saveliy Tretiakov da13fb5a41 NtUserLoadKeyboardLayoutEx: Support KLF_REORDER and KLF_ACTIVATE.
NtUserActivateKeyboardLayout: Support HKL_NEXT, HKL_PREV, KLF_REORDER.


svn path=/trunk/; revision=25879
2007-02-22 19:41:10 +00:00
Magnus Olsen 06b4e06c8a win32k dx test are now compatible with all Windows and ReactOS that got a d3d8thk.dll file
rember that file are diffent for Windows 2000 and Windows XP/2003 ReactOS d38thk.dll are Windows XP/2003 compatible. 

svn path=/trunk/; revision=25878
2007-02-22 19:21:10 +00:00
Magnus Olsen 92213f75ef Move d3d8thk.h for it being use for apps that need todo win32k syscall for directx graphice part
svn path=/trunk/; revision=25877
2007-02-22 19:10:40 +00:00
Sylvain Petreolle 717a91df43 fix build
svn path=/trunk/; revision=25876
2007-02-22 18:48:01 +00:00
Alex Ionescu f141767094 - Rename LdrLoadModule to MmLoadSystemImage and change prototype. No code change except update callers and return ImageBaseAddress parameter when requested.
svn path=/trunk/; revision=25875
2007-02-22 18:30:50 +00:00
Alex Ionescu 31446c8a3b - Improve LdrGetModuleObject (in FreeLDR) to handle partial names too, so NTOSKRNL will still match NTOSKRNL.EXE. This is needed for forwarder support.
- Implement LdrPEFixupForward in FreeLDR and update LdrPEGetExportByName to use it, so that FreeLDR can now parse import tables with forwarders.
- Add call to MmInitSystem for Phase 0 in ExpInitializeExecutive.
- Completely redesign the way boot drivers are handled. They're now re-mapped during Phase 0 MmInit (part of the re-mapping is a hack until FreeLDR 2.5 is ready) and the IoMgr only does I/O stuff, not PE loading anymore (this is only half-true, we still process imports until FreeLDR 2.5 is done).
- Also re-design the way the module list head is initialized and used. LdrInit1 is now gone, Phase 0 MmInit now handles initializing it and copying boot loader data to it.
- Some code is still missing and functions still need to be improved.
- When FreeLDR 2.5 is ready some of the hacks will go away, they're #ifed for now to make it easy to switch.

svn path=/trunk/; revision=25874
2007-02-22 18:02:53 +00:00
Hervé Poussineau 5f18dde527 Fix build with gcc 4.1.2
svn path=/branches/alex-kd-branch/; revision=25873
2007-02-22 00:14:20 +00:00
Alex Ionescu 40e1082e3d - Rename ModuleListHead to PsLoadedModulesList.
- Start implementing some routines of the Mm SysLdr. Implemented MiSnapThunk and most of MiResolveImageReferences. The SysLdr has a lot of restrictions that the typical Ldr in user-mode doesn't, as well as manages imports and reference counts them, so the code can't be shared with ntdll's Ldr (this is also why real NT doesn't have an Ldr component, and this is in Mm).
- Fix some PE Header types that were wrong in our PSDK.

svn path=/trunk/; revision=25872
2007-02-22 00:01:52 +00:00
Magnus Olsen 6751f1721e adding a helper intEnableDriver it will be use for enable the dx driver for the graphice card.
rewrote NtGdiDdQueryDirectDrawObject so it only copy the cache data only. This will speed up allot. we only need call on NtGdiDdCreateDirectDrawObject yo setup the whole cache and enable the drv with the helper functions. the NtGdiDdQueryDirectDrawObject will be faster like this. using RtlCopyMemory insted for RtlMemMove  and allot other change in it. adding _SEH to NtGdiDdQueryDirectDrawObject so user can not crash it any longer. 

svn path=/trunk/; revision=25870
2007-02-21 22:19:31 +00:00
Timo Kreuzer b43aa6554f Silence some warnings
svn path=/trunk/; revision=25869
2007-02-21 22:04:59 +00:00
Alex Ionescu 012009365d - Implement ExpQueryModuleInformation to handle SystemModuleInformation, instead of LdrpQueryModleInformation. This version properly fills out all the data required and also supports (but doesn't yet handle) user-mode modules.
- Start work on supporting NT-compatible System Loader that properly fills out LDR_DATA_TABLE_ENTRY and handles imports correctly. Modified LdpPEProcessModule to properly build the data table entry and create the base name and directory name.
- Add stub for MiResolveImageRefernces.

svn path=/trunk/; revision=25868
2007-02-21 18:43:57 +00:00
Dmitry Gorbachev af1995f6f1 Thai translation (Sumath Aowsakulsutthi)
svn path=/trunk/; revision=25867
2007-02-21 18:23:59 +00:00
Dmitry Gorbachev 8f0b7ce68c Thai translation (Sumath Aowsakulsutthi)
svn path=/trunk/; revision=25866
2007-02-21 18:22:30 +00:00
Dmitry Gorbachev 4d0c6f3b50 Thai translation by Sumath Aowsakulsutthi (punth1 at gmail dot com)
svn path=/trunk/; revision=25865
2007-02-21 18:22:11 +00:00
Dmitry Gorbachev d6122e01fa Fix Italian resource file
svn path=/trunk/; revision=25863
2007-02-21 11:41:17 +00:00
Alex Ionescu 828eda9888 - Properly implement SystemLoadGdiDriverInformation.
- Properly implement SystemExtendServiceTableInformation, except that the SE_LOAD_DRIVER_PRIVILEGE check is currently disabled since our smss doesn't acquire it (and we should therefore ban it from loading win32k.sys...).
- Delete LdrpLoadImage, LdrpUnlaodImage, LdrpLoadAndCallImage.

svn path=/trunk/; revision=25862
2007-02-21 02:46:30 +00:00
Alex Ionescu effa3a52ef - Cleanup loader.c and comment some public routines (no code change).
- Temporarily remove routines to set per-page protection (this doesn't really break anything, just makes the OS less secure).

svn path=/trunk/; revision=25861
2007-02-21 01:57:02 +00:00
Alex Ionescu 226a94773d - Get rid of a bunch of multiboot crap FreeLDR was still doing for ReactOS.
- Remove some of the sixtuplicated routines to load a PE file. We're now down to a single function which takes an ImageType parameter for DLL/EXE/SYS, but even this is still temporary as the parameter will soon go away.
- We now load drivers in the same nice way that we load the kernel and DLLs, but we don't yet process their imports and relocate them in FreeLDR, because FreeLDR doesn't handle forwarders yet.
- We don't need a large hack in KiRosPrepareForSystemStartup anymore since the driver base addresses are now proper.
- Don't free boot-drivers anymore, since we'll load them in place soon.
- Don't load bootvid twice.
- Remove PAE stuff in FreeLDR since we don't support PAE anyway in the kernel and when we do, might as well implement it cleanly instead of relying on the broken FreeLDR stuff.

svn path=/trunk/; revision=25860
2007-02-20 20:02:52 +00:00
Alex Ionescu 8bac7fc287 - Don't load .SYM in freeldr anymore.
- Fix generation of driver name for symbol load.

svn path=/branches/alex-kd-branch/; revision=25859
2007-02-20 16:39:31 +00:00
Alex Ionescu d4d61262dc - Fix loading of boot symbols.
- Fix bug in KdpLoadSymbolsStateChange, we were never actually copying the pathname.
- Output of lm:
kd> lm
start    end        module name
80000000 80283000   nt         (export symbols)       ntoskrnl.exe
80283000 8029d000   hal        (export symbols)       halup.dll

svn path=/branches/alex-kd-branch/; revision=25858
2007-02-20 06:51:16 +00:00
Alex Ionescu b4c37fe1c4 - Add ExceptionRecord32To64.
- Implement KdpReportExceptionStateChange and fully support KdpReport.
- We now properly break inside HAL (with /BREAK) and WinDBG shows a nice stack trace, and disassembly, and I can step through the HAL initialization code!

svn path=/branches/alex-kd-branch/; revision=25857
2007-02-20 06:25:58 +00:00
Alex Ionescu 08b99faedd - Properly sign-extend a couple more pointers. WinDBG is still complaining about two of them though.
svn path=/branches/alex-kd-branch/; revision=25856
2007-02-20 05:02:52 +00:00
Alex Ionescu 86bcfc31af - Implement KdpGetStateChange.
- Implement DbgKdContinueApi and DbgKdContinueApi2 cases.
- Remove several while (TRUE);s which started being hit since our code is working fine.
- WinDBG gets notifications for all the drivers/symbols being loaded and ROS now boots to bootvid logo, but we don't yet break-in.

svn path=/branches/alex-kd-branch/; revision=25855
2007-02-20 04:57:43 +00:00
Alex Ionescu 69a6af0124 - Implement KdpWriteControlSpace.
- Fix a bug in KdpSetContext.
- Use DR_MASK and DR7_OVERRIDE_V in KiUpdateDr7, KiRecordDr7 instead of DR_ACTIVE_MASK.
- We now get DbgKdContinueApi2 from WinDBG meaning that the first phase of KD communication is almost over!

svn path=/branches/alex-kd-branch/; revision=25854
2007-02-20 04:38:01 +00:00
Alex Ionescu bf616180df - Implement KdpSetContext.
- Fix KdpReport, it was totally out of whack.

svn path=/branches/alex-kd-branch/; revision=25853
2007-02-20 03:45:11 +00:00
Alex Ionescu 3006d54080 - KPROCESSOR_STATE is not 4-byte aligned.
- Fail physical memory reads for now.
- Use the right kernel load address.
- Generate image name when loading boot symbols. Now WinDBG sees "ntoskrnl.exe".
- Fix KiSaveProcessorControlState and KiRestoreProcessorControlSate. The latter doesn't freeze the CPU anymore so it's enabled, and the former doesn't cause WinDBG to panic anymore and display weird data.

svn path=/branches/alex-kd-branch/; revision=25852
2007-02-20 03:22:30 +00:00
Alex Ionescu b9b5323515 - Implement DbgKdClearAllInternalBreakpointsApi
- Implement KdpGetContext for DbgKdGetContextApi.
- WinDBG now goes to Phase 2 connection and prints out:
Windows Server 2003 Kernel Version 3790 UP Checked x86 compatible
Built by: 20070215-r25797
Kernel base = 0x80100000 PsLoadedModuleList = 0x80112230

svn path=/branches/alex-kd-branch/; revision=25851
2007-02-20 02:12:39 +00:00
Alex Ionescu f3488993eb - Add kdbreak.c with the following APIs: KdpLowWriteContent, KdpLowRestoreBreakpoint, KdpDeleteBreakpoint, KdpDeleteBreakpointRange, KdpRestoreAllBreakpoints. Adding breakpoints not yet supported.
- Enable kdinit.c call to KdpRestoreAllBreakpoints.
- Add breakpoint table and data.
- Support DbgKdRestoreBreakpointApi. Now we get DbgKdClearAllInternalBreakpointsApi.

svn path=/branches/alex-kd-branch/; revision=25850
2007-02-20 02:00:01 +00:00
Alex Ionescu 24f9e136e6 - Add a bunch of hacks to KdpReadVirtualMemory to make it work for now.
- Fix bugs in KdpGetVersion, KdpReadVirtualMemory.
- Implement KdpReadControlSpace.
- Fix setting kernel range address instead of kernel image load address.
- WinDBG is slowly trying to talk with us. Now it wants to restore breakpoints since it thinks this is the same machine I was debugging last night.

svn path=/branches/alex-kd-branch/; revision=25849
2007-02-20 01:13:22 +00:00
Ged Murphy b4f7cf3523 add chars to the edit box when either double clicked or the select button is hit
svn path=/trunk/; revision=25848
2007-02-19 23:56:16 +00:00
Alex Ionescu f42e752565 - Create ntverp.h and common.ver files. These are the standard files used by the NT/DDK build systems and we should try to support them as well instead of re-defining everything our own way (especially if we want to build ddk-compatible drivers later on).
- Made init.c use version data from ntverp.h instead of hard-coding.
- Defined NT 5.2.3790.1830 as the version we report.
- Fixed up .rc file to be correct and match DDK-sytnax/style.
- For now only the kernel uses this new versionning scheme, but we should change the build system later to use this for every component.

svn path=/branches/alex-kd-branch/; revision=25847
2007-02-19 22:28:50 +00:00
Alex Ionescu 1654674e55 - Implement KdpSysGetVersion, KdpGetVersion, KdpReadVirtualMemory.
- Fix bugs in KdInitSystem; some 64-bit pointers must be sign-extneded, not zero-extended (thanks Myria!)
- Properly read kernel base instead of kernel stack.
- Fix compile issue due to incorrect KiBugCheckData definition.
- WinDBG reports: "Connected to Windows Vista 16199 x86 compatible target, ptr64 FALSE. Kernel Debugger connection established.  (Initial Breakpoint requested)"

svn path=/branches/alex-kd-branch/; revision=25846
2007-02-19 21:30:26 +00:00
Alex Ionescu b9cd3f2d9d - Create GCC_ULONG64 type to hack around a bug in GCC which is incapable of creating entries for externals at compile-time for 64-bit pointers.
- Rename NameSpaceRoot to ObpRootDirectoryObject, IopLogListHead to IopErrorLogListHead, BugcheckCallbackListHead to KeBugcheckCallbackListHead, BugcheckReasonCallbackListHead to KeBugcheckReasonCallbackListHead, ObTypeObjectType to ObpTypeObjectType.
- Fill out KdDebuggerDataBlock with the variables that ROS currently supports. Most Mm variables we don't have yet -- it's unknown how much this will hurt WinDBG compatibility/functionality.
- Add KdPrint circular buffer and buffer location/data variables.

svn path=/branches/alex-kd-branch/; revision=25845
2007-02-19 18:52:23 +00:00
Eric Kohl d8e1e7bba4 Enable the user to set the size of captions, caption buttons, menu bars and croll bars.
svn path=/trunk/; revision=25844
2007-02-19 16:12:38 +00:00
Alex Ionescu f1f1afaa74 - We now tell WinDBG to load kernel symbols and WinDBG replies (!) with DbgKdGetVersionApi to find out who we are (he's in for a surprise ;)):
- Implement KdpSetCommonState (except code to clear breakpoints).
  - Implement KdpSetContextState (for x86).
  - Implement KdpReportLoadSymbolsStateChange.
  - Implement skeleton of KdpSendWaitContinue, the main KD API Loop.
  - Add KCONTINUE_STATUS.
  - Redefine KdReceivePacket's return value to KDSTATUS and define possibile values.
  - Add DBGKD_ANY_CONTROL_SET and X86/IA64/AMD64 control sets.
  - Add DBGKD_MANIPULATE_STATE64 and all sub-structures (READ_MEMORY, WRITE_MEMORY, etc).
  - Fix definition of KdpSymbol.

svn path=/branches/alex-kd-branch/; revision=25843
2007-02-19 15:02:39 +00:00
Dmitry Gorbachev f49c3528f3 Fix a bug
svn path=/trunk/; revision=25842
2007-02-19 13:20:09 +00:00
Thomas Bluemel 5c7f9d04ce Minor fixes, thanks Ged
svn path=/trunk/; revision=25841
2007-02-19 13:15:28 +00:00
Alex Ionescu 53c4c13732 - Dummy commit for documentation purposes:
"The KD64 6.0 implementation is based on information from the VSJ article located at: http://www.vsj.co.uk/articles/display.asp?id=265 by Albert Alameida. Although Windows 2000 shipped with KD64 5.0, much of the implementation details have not changed. Additionally, the Windows 2000 DDK (accidentally?) shipped with a file called windbgkd.h which contains internal KD64 information and documentation. WinDBG's SDK ships with wdbgexts.h which contains more internal information on some portable structures. Other information was gathered through people such as Skywing."

svn path=/branches/alex-kd-branch/; revision=25840
2007-02-18 22:46:01 +00:00