Difference between revisions of "Kernel32.dll"

From ReactOS Wiki
Jump to: navigation, search
m
m
Line 192: Line 192:
 
* Use the share disposition to detect the direction of a pipe. ([[Hartmut Birr]]
 
* Use the share disposition to detect the direction of a pipe. ([[Hartmut Birr]]
 
* Removed some escape sequences from the command line in CreateProcessInternalW. ([[Hartmut Birr]]).
 
* Removed some escape sequences from the command line in CreateProcessInternalW. ([[Hartmut Birr]]).
 +
 +
[[ChangeLog-0.3.1]]
 +
* Update ActiveContext functions ([[Aleksey Bragin]])
 +
* Call some APIs with the right DesiredAccess instead of allways sending _ALL_ACCESS. (for example, only use SECTION_MAP_READ | QUERY unless the caller wants r/w.  ([[Alex Ionescu]])
 +
* Flush ITLB when writing to process memory.  ([[Alex Ionescu]])
 +
* Entirely rewrite Kernel32 Probe functions to um, actually probe (ported Thomas's code in the kernel and adjusted for user-mode and then checked with WINE's code). I can't begin to fathom what the previous routines were supposed to be doing.  ([[Alex Ionescu]])
 +
* Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it.  ([[Alex Ionescu]])
 +
* Rewrote Base Heap implementation nearly from scratch, currently only for Global Heap (Local Heap is as broken as before, since it still calls the Global Heap APIs). For detailed implementation notes, see baseheap.h  ([[Alex Ionescu]])
 +
* Main changes include using the RtlHandle package instead of duplicating an internal implementation, as well as using the RtlHeap* APIs that allow for setting User Flags/Values for associating Base Heap Flags/Handles with the actual RTL-managed block.  ([[Alex Ionescu]])
 +
* Fixup Local* Heap implementation so that calls which have different semantics don't call the Global APIs (ie: LocalAlloc/LocalReAlloc and LocalFlags). The rest can be shared beteween them. Also fix some prototypes.  ([[Alex Ionescu]])
 +
* Rename all the defintions to BASE_HEAP instead of GLOBAL_HEAP, since they apply just as well to the Local Heap.  ([[Alex Ionescu]])
 +
* Reformat heap.c to ROS standards  ([[Alex Ionescu]])
 +
* HeapCreate should mask out NT flags and tag allocations with CLASS 1.  ([[Alex Ionescu]])
 +
* Implemented HeapCreateTagsW, HeapExtend, HeapQueryTagW, HeapSummary, HeapUsage.  ([[Alex Ionescu]])
 +
* Sync with WINE's latest Heap implementation and try to remove some of the differences we had, and also document the ones which must be kept (our support for RTL_HEAP_COMMIT_ROUTINE and usage of user/kernel-mode lock APIs, etc). This reduces the heap/alloc regression tests to only 1 issue (which I'm working on fixing).  ([[Alex Ionescu]])
 +
* Fix a typo in a comparison (& vs &&) which was breaking GlobalReAlloc in some cases.  ([[Alex Ionescu]])
 +
* Fix a missing | (OR) in GlobalAlloc which created an invalid handle if the first allocation was of size 0.  ([[Alex Ionescu]])
 +
* Same fixes for LocalAlloc/LocalReAlloc  ([[Alex Ionescu]])
 +
* Create the BNO Global and Local symbolic links in kernel32.  ([[Alex Ionescu]])
 +
* Make CheckRemoteDebuggerPresent fail if no process was specified.  ([[Alex Ionescu]])
 +
* Implement DebugActiveProcess, DebugActiveProcessStop, DebugBreakProcess, DebugSetProcessKillOnExit.  ([[Alex Ionescu]])
 +
* Rewrite all synch object wrappers in kernel32 to use a single unified method of implementation.  ([[Alex Ionescu]])
 +
* A->W converstion through static TEB buffer.  ([[Alex Ionescu]])
 +
* Failure if opening without a name.  ([[Alex Ionescu]])
 +
* Special warning code for objects that already exist (fixes some WINE test failures and probably makes a myriad of applications work).  ([[Alex Ionescu]])
 +
* Use BasepConvertObjectAttributes when creating an object to remove code duplication.  ([[Alex Ionescu]])
 +
* InitializeCrticalSectionAndSpinCount shouldn't raise an exception on failure.  ([[Alex Ionescu]])
 +
* Optimize WaitForMultipleObjects to cache 8 objects on the stack instead of only 3.  ([[Alex Ionescu]])
 +
* Define DBGSS_THREAD_DATA and DbgSsGet/SetThreadData. This is what is located in DbgSsReserved[0] (an internal high-level structure that subsystem debuggers can use for whatever purposes they need). DbgSsReserved[1] is the actual native debug object used only by DbgUi in ntdll.  ([[Alex Ionescu]])
 +
* Implement SaveThreadHandle, SaveProcesHandle, MarkThreadHandle, MarkProcessHandle, RemoveHandles and CloseAllProcessHandles to deal with this structure.  ([[Alex Ionescu]])
 +
* Call these functions when required, except for WaitForDebugEvent which will set them up once implemented.  ([[Alex Ionescu]])
 +
* Implement WaitForDebugEvent. Calls out to DbgUiConvertWaitStateStructure which is still unimplemented.  ([[Alex Ionescu]])

Revision as of 04:49, 3 April 2012

Kernel32.dll is NOT synced with WINE, it is made by ReactOS (source)


http://en.wikipedia.org/wiki/Microsoft_Windows_library_files#Kernel32.dll

http://en.wikipedia.org/wiki/Windows_API#Overview

http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/?view=log

ChangeLog-0.0.12

kernel32 now compiles (only as a static library)

ChangeLog-0.0.18

  • Rewrote atom functions in kernel32

ChangeLog-0.0.20

ChangeLog-0.0.21

ChangeLog-0.1.0

  • Kernel32: Improved file attribute and file time handling (Gé van Geldorp)
  • Kernel32: Added support for lauching VDM on dos image load (Robert Dickenson)
  • Kernel32: Implemented GetThreadPriotityBoost() and SetThreadPriorityBoost() (Eric Kohl)

ChangeLog-0.1.1

ChangeLog-0.1.3

ChangeLog-0.1.5

ChangeLog-0.2.1

  • Use return value of GetLocaleInfoW() in GetTimeFormatW() (Martin Fuchs)
  • Added language resources for english, german and french (Martin Fuchs)
  • Don't clear GetTimeFormat() flags when calling RosGetTimeFormat() (Martin Fuchs)
  • Corrected TIME_NOSECONDS handling (Martin Fuchs)
  • Minor fix in GlobalMemoryStatus to get some applications happy (Filip Navara)
  • Implemented GetUserDefaultLangID and GetUserDefaultLCID; fixes bug #108 (Filip Navara)
  • Don't wait for GUI processes to finish (Gé van Geldorp)
  • GetLocaleInfoA implemented (copied from wine) (Gunnar Dalsnes)
  • Implementation of InitializeCriticalSectionAndSpinCount and RtlInitializeCriticalSectionAndSpinCount (Filip Navara)
  • Fixed relocation problem to re-activate new error messages (Martin Fuchs)
  • Implement some profile (.ini file) functions (Gé van Geldorp)
  • Implemented Write(Private)ProfileStringA/W (Gé van Geldorp)
  • CreateFileMappingA/CreateFileMappingW: a NULL size argument for this function should result in the filesize being used (Gero Kuehn)
  • GetComputerName(Ex)?[AW] implemented (Art Yerkes)
  • Check RtlAllocateHeap() return value for 8-byte alignment (Gé van Geldorp and Mark Tempel)

ChangeLog-0.2.2

ChangeLog-0.2.3

ChangeLog-0.2.4

  • More complete implementation of CharUpperA. (Filip Navara)
  • Implement ReadConsoleInputW, PeekConsoleInputW, ReadConsoleOutputW, WriteConsoleOutputW, SetConsoleIcon and GetConsoleWindow. (Filip Navara)
  • Fix Get[System/Window]Directory[AW] for Buffer == NULL case. (Filip Navara)
  • Fix return value of GetDriveType[AW]. (Filip Navara)
  • Implementation of GetCPFileNameFromRegistry, GetNlsSectionName and IsValidCodePage. (Filip Navara)
  • Partial implementation of MultiByteToWideChar and WideCharToMultiByte. (Filip Navara)
  • Fix realloc to not call HeapReAlloc for allocating new memory. (Filip Navara)
  • Remove invalid code from CreateToolhelp32Snapshot. (Filip Navara)
  • RtlReAllocateHeap shouldn't allocate memory if ptr == NULL. (Filip Navara)
  • Simplify CreateFileMapping[AW]. (Filip Navara)
  • Fix return value of GlobalReAlloc and GlobalUnlock. (Filip Navara)
  • Fix converting of UTF8 sequences in IntMultiByteToWideCharUTF8. (Filip Navara)
  • Properly set last error in WaitForSingleObjectEx. (Filip Navara)
  • Implemented GetACP() and GetOEMCP(). (Hartmut Birr)
  • Handle file names like ./somename in SearchPath() (Gé van Geldorp)
  • Don't reset LastError on success (CreateFile) (Gé van Geldorp)
  • Fix WinExec return value (Gé van Geldorp)
  • Implemented timer queue functions (Thomas Weidenmueller)
  • Implemented Get/SetProcessPriorityBoost (only the kernel32 part) (Thomas Weidenmueller)
  • Fixed copying LARGE_INTEGER structs to FILETIME structs that may cause alignment problems (Thomas Weidenmueller)

ChangeLog-0.2.5

  • Split up the handling if the fsd returns STATUS_NOT_IMPLEMENTED in MoveFileWithProgressW. Converted the destination name before calling NtSetInformationFile in MoveFileWithProgressW. (Hartmut Birr)
  • Used the shared user data page instead of NtQuerySystemTime to get the time. (Hartmut Birr)
  • Implemented SetDllDirectory() and GetDllDirectory() (Thomas Weidenmueller)
  • Implemented CheckRemoteDebuggerPresent(), GetThreadIOPendingFlag(), CreateMemoryResourceNotification() and QueryMemoryResourceNotification() (only kernel32 part) (Thomas Weidenmueller)
  • Made SetUnhandledExceptionFilter() thread-safe and use the default unhandled exception filter on startup (Thomas Weidenmueller)
  • Implemented undocumented GetConsoleInputExeNameA/W() and SetConsoleInputExeNameA/W() used by NT's cmd.exe (Thomas Weidenmueller)
  • Added stub for SetThreadUILanguage() to get NT's cmd.exe to load (Thomas Weidenmueller)
  • Implemented GetUserDefaultUILanguage(), WriteConsoleW(), ReadConsoleW(), FillConsoleOutputCharacterW(), WriteConsoleInputW(), ReadConsoleOutputCharacterW(), ScrollConsoleScreenBufferW(), GetProcessIdOfThread(), GetThreadId(), GetThreadSelectorEntry(), SetProcessWorkingSetSize(), GetProcessHandleCount(), GetSystemRegistryQuota(), CheckNameLegalDOS8Dot3A/W(), IsDBCSLeadByte() and IsDBCSLeadByteEx() (Thomas Weidenmueller)
  • Fixed ProcessIdToSessionId() to actually work and some minor fixes to GetHandleInformation(), SetHandleInformation(), CloseHandle() and DuplicateHandle() (Thomas Weidenmueller)
  • Implemented GetNamedPipeHandleStateA() and a few fixes for GetNamedPipeHandleStateW(), atomically increment pipe IDs to be thread-safe (Thomas Weidenmueller)
  • Create mailslots and named pipes with security information if requested (Thomas Weidenmueller)
  • Fixed return value of FindCloseChangeNotification() (Thomas Weidenmueller)
  • Implemented ToolHelp API: Heap32ListFirst(), Heap32ListNext(), Module32First(), Module32FirstW(), Module32Next(), Module32NextW(), Process32First(), Process32FirstW(), Process32Next(), Process32NextW(), Thread32First(), Thread32Next(), Toolhelp32ReadProcessMemory() and CreateToolhelp32Snapshot() (Thomas Weidenmueller)
  • Fixed memory leak in CheckNameLegalDOS8Dot3A() (free the allocated unicode string) (Thomas Weidenmueller)
  • Fixed Set/GetPriorityClass() not to call csrss and use NtSet/QueryInformationProcess() instead (Thomas Weidenmueller)
  • Implemented Job APIs: CreateJobObjectA/W(), OpenJobObjectA/W(), IsProcessInJob(), AssignProcessToJobObject(), QueryInformationJobObject(), SetInformationJobObject() and TerminateJobObject() (Thomas Weidenmueller)

ChangeLog-0.2.6

  • Rewrote ROS Critical Section implementation. Newer one is more complete, faster, and supports debug information. Thanks to Gunnar as well. (Alex Ionescu)


Kernel32.dll is a Win32 library

ChangeLog-0.2.7

  • Implemented GetCommProperties, ClearCommError, CommConfigDialogA, CommConfigDialogW (Saveliy Tretiakov)
  • Implemented GetCommConfig, SetCommConfig, FindFirstFileExW (Dmitry Philippov)

ChangeLog-0.2.8

  • Implemented CreateSymbolicLink. (Thomas Weidenmueller)
  • Implemented IsThreadAFiber. (Thomas Weidenmueller)
  • Fixed GetEnvironmentVariable memory allocation. (Thomas Weidenmueller)
  • Implemented GetSecurityInfo, SetSecurityInfo, GetNamedSecurityA/W, SetNamedSecurityInfoA/W, SetEntriesInAclA/W, GetInheritanceSource, FreeInheritedFromArray, GetExplicitEntriesFromAcl, and TreeResetNamedSecurityInfo. (Thomas_Weidenmueller)
  • Reimplment FindFirstFileEx. (Hartmut Birr)
  • Implement MoveFileWithProgressW so it can handle movefile / folder on a volume or to another one. It does not set the attrib or take the EA at accunt (Magnus Olsen)
  • Implement SetComputerNameExA/W (Hervé Poussineau)
  • Rewrote process and thread creation/termination functions to support for:
    • SxS,
    • SFP (SAFER),
    • DllPaths,
    • Proper process environment/paramter block creation
    • Proper console handle management,
    • Tokens/CreateProcessAsUser,
    • Simpler code for path lookup, and more robust.
    • Support for "auto-correction"
    • 16-bit/NE detection
    • A variety of creation flags are now properly supported
    • Added support for an undocumented-yet-known shell flag
    • Alert for flags we don't support yet
    • Catch invalid flag combinations and other caller errors
    • Improve and correct path searcing to use documented behaviours

(Alex Ionescu)

  • Updated fiber support. Added support for Sxs, FLS, FPU State Save, sped up code and fixed startup parameters (Alex Ionescu)
  • Fix wrong SignalObjectAndWait return values. (Alex Ionescu)
  • Retry waiting if STATUS_ALERTED is returned (Alex Ionescu)
  • Open BNO directory with correct privileges, open CSR connection with correct path.
  • Add InWindows boolean to use the right CSR ServerID in windows and add a hack to get kernel32 to be loadable if used with .local to force an application to use our kernel and not the system one. The result of this is that our kernel32 can now load in Windows XP (not 2000). (Alex Ionescu)
  • Export and implement CreateProcessInternalA and CreateProcessInternalW (Alex Ionescu)
  • Export and implement NlsGetCacheUpdateCount (Alex Ionescu)
  • Bug fixes in CreateProcess. (Hartmut Birr)
  • Allocated a converting buffer for WideCharToMultiByte. bug #702. (Hartmut Birr)

ChangeLog-0.2.9

  • Fix Firefox installer (Gé van Geldorp)
  • Implement proper version of WaitNamedPipeW to be used when NPFS will be modified to work as documented. (Alex Ionescu)
  • Fix CreateNamedPipeW to convert some NT flags properly, timeouts, etc. (Alex Ionescu)
  • Fix CallNamedPipeW, the pipe mode should also be set to PIPE_WAIT. (Alex Ionescu)
  • Fix bugs in PeekNamedPipe and DisconnectNamedPipe. (Alex Ionescu)
  • Use the share disposition to detect the direction of a pipe. (Hartmut Birr
  • Removed some escape sequences from the command line in CreateProcessInternalW. (Hartmut Birr).

ChangeLog-0.3.1

  • Update ActiveContext functions (Aleksey Bragin)
  • Call some APIs with the right DesiredAccess instead of allways sending _ALL_ACCESS. (for example, only use SECTION_MAP_READ | QUERY unless the caller wants r/w. (Alex Ionescu)
  • Flush ITLB when writing to process memory. (Alex Ionescu)
  • Entirely rewrite Kernel32 Probe functions to um, actually probe (ported Thomas's code in the kernel and adjusted for user-mode and then checked with WINE's code). I can't begin to fathom what the previous routines were supposed to be doing. (Alex Ionescu)
  • Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it. (Alex Ionescu)
  • Rewrote Base Heap implementation nearly from scratch, currently only for Global Heap (Local Heap is as broken as before, since it still calls the Global Heap APIs). For detailed implementation notes, see baseheap.h (Alex Ionescu)
  • Main changes include using the RtlHandle package instead of duplicating an internal implementation, as well as using the RtlHeap* APIs that allow for setting User Flags/Values for associating Base Heap Flags/Handles with the actual RTL-managed block. (Alex Ionescu)
  • Fixup Local* Heap implementation so that calls which have different semantics don't call the Global APIs (ie: LocalAlloc/LocalReAlloc and LocalFlags). The rest can be shared beteween them. Also fix some prototypes. (Alex Ionescu)
  • Rename all the defintions to BASE_HEAP instead of GLOBAL_HEAP, since they apply just as well to the Local Heap. (Alex Ionescu)
  • Reformat heap.c to ROS standards (Alex Ionescu)
  • HeapCreate should mask out NT flags and tag allocations with CLASS 1. (Alex Ionescu)
  • Implemented HeapCreateTagsW, HeapExtend, HeapQueryTagW, HeapSummary, HeapUsage. (Alex Ionescu)
  • Sync with WINE's latest Heap implementation and try to remove some of the differences we had, and also document the ones which must be kept (our support for RTL_HEAP_COMMIT_ROUTINE and usage of user/kernel-mode lock APIs, etc). This reduces the heap/alloc regression tests to only 1 issue (which I'm working on fixing). (Alex Ionescu)
  • Fix a typo in a comparison (& vs &&) which was breaking GlobalReAlloc in some cases. (Alex Ionescu)
  • Fix a missing | (OR) in GlobalAlloc which created an invalid handle if the first allocation was of size 0. (Alex Ionescu)
  • Same fixes for LocalAlloc/LocalReAlloc (Alex Ionescu)
  • Create the BNO Global and Local symbolic links in kernel32. (Alex Ionescu)
  • Make CheckRemoteDebuggerPresent fail if no process was specified. (Alex Ionescu)
  • Implement DebugActiveProcess, DebugActiveProcessStop, DebugBreakProcess, DebugSetProcessKillOnExit. (Alex Ionescu)
  • Rewrite all synch object wrappers in kernel32 to use a single unified method of implementation. (Alex Ionescu)
  • A->W converstion through static TEB buffer. (Alex Ionescu)
  • Failure if opening without a name. (Alex Ionescu)
  • Special warning code for objects that already exist (fixes some WINE test failures and probably makes a myriad of applications work). (Alex Ionescu)
  • Use BasepConvertObjectAttributes when creating an object to remove code duplication. (Alex Ionescu)
  • InitializeCrticalSectionAndSpinCount shouldn't raise an exception on failure. (Alex Ionescu)
  • Optimize WaitForMultipleObjects to cache 8 objects on the stack instead of only 3. (Alex Ionescu)
  • Define DBGSS_THREAD_DATA and DbgSsGet/SetThreadData. This is what is located in DbgSsReserved[0] (an internal high-level structure that subsystem debuggers can use for whatever purposes they need). DbgSsReserved[1] is the actual native debug object used only by DbgUi in ntdll. (Alex Ionescu)
  • Implement SaveThreadHandle, SaveProcesHandle, MarkThreadHandle, MarkProcessHandle, RemoveHandles and CloseAllProcessHandles to deal with this structure. (Alex Ionescu)
  • Call these functions when required, except for WaitForDebugEvent which will set them up once implemented. (Alex Ionescu)
  • Implement WaitForDebugEvent. Calls out to DbgUiConvertWaitStateStructure which is still unimplemented. (Alex Ionescu)