Author: dchapyshev Date: Sat Jan 17 09:27:35 2009 New Revision: 38819
URL: http://svn.reactos.org/svn/reactos?rev=38819&view=rev Log: - Implement AllocateUserPhysicalPages, FreeUserPhysicalPages, MapUserPhysicalPages, MapUserPhysicalPagesScatter, ResetWriteWatch - Fix return value for CreateSocketHandle - Fix arguments for DelayLoadFailureHook (see http://msdn.microsoft.com/en-us/library/bb432244(VS.85).aspx)
Modified: trunk/reactos/dll/win32/kernel32/mem/virtual.c trunk/reactos/dll/win32/kernel32/misc/stubs.c
Modified: trunk/reactos/dll/win32/kernel32/mem/virtual.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/virt... ============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/virtual.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/mem/virtual.c [iso-8859-1] Sat Jan 17 09:27:35 2009 @@ -289,11 +289,140 @@
if (!NT_SUCCESS(Status)) { - SetLastError(RtlNtStatusToDosError(Status)); + SetLastErrorByStatus(Status); return -1; }
return 0; }
+/* + * @implemented + */ +UINT +WINAPI +ResetWriteWatch( + LPVOID lpBaseAddress, + SIZE_T dwRegionSize + ) +{ + NTSTATUS Status; + + Status = NtResetWriteWatch(NtCurrentProcess(), + lpBaseAddress, + dwRegionSize); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return -1; + } + + return 0; +} + +/* + * @implemented + */ +BOOL +WINAPI +AllocateUserPhysicalPages( + HANDLE hProcess, + PULONG_PTR NumberOfPages, + PULONG_PTR UserPfnArray + ) +{ + NTSTATUS Status; + + Status = NtAllocateUserPhysicalPages(hProcess, + NumberOfPages, + UserPfnArray); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +FreeUserPhysicalPages( + HANDLE hProcess, + PULONG_PTR NumberOfPages, + PULONG_PTR PageArray + ) +{ + NTSTATUS Status; + + Status = NtFreeUserPhysicalPages(hProcess, + NumberOfPages, + PageArray); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +MapUserPhysicalPages( + PVOID VirtualAddress, + ULONG_PTR NumberOfPages, + PULONG_PTR PageArray OPTIONAL + ) +{ + NTSTATUS Status; + + Status = NtMapUserPhysicalPages(VirtualAddress, + NumberOfPages, + PageArray); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +MapUserPhysicalPagesScatter( + PVOID *VirtualAddresses, + ULONG_PTR NumberOfPages, + PULONG_PTR PageArray OPTIONAL + ) +{ + NTSTATUS Status; + + Status = NtMapUserPhysicalPagesScatter(VirtualAddresses, + NumberOfPages, + PageArray); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + /* EOF */
Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/stu... ============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Sat Jan 17 09:27:35 2009 @@ -293,21 +293,6 @@ }
/* - * @unimplemented - */ -BOOL -WINAPI -AllocateUserPhysicalPages( - HANDLE hProcess, - PULONG_PTR NumberOfPages, - PULONG_PTR UserPfnArray - ) -{ - STUB; - return 0; -} - -/* * @implemented */ BOOL @@ -359,22 +344,6 @@ STUB; return 0; } - -/* - * @unimplemented - */ -BOOL -WINAPI -FreeUserPhysicalPages( - HANDLE hProcess, - PULONG_PTR NumberOfPages, - PULONG_PTR PageArray - ) -{ - STUB; - return 0; -} -
/* * @unimplemented @@ -444,36 +413,6 @@ HEAP_INFORMATION_CLASS HeapInformationClass, PVOID HeapInformation OPTIONAL, SIZE_T HeapInformationLength OPTIONAL - ) -{ - STUB; - return 0; -} - -/* - * @unimplemented - */ -BOOL -WINAPI -MapUserPhysicalPages( - PVOID VirtualAddress, - ULONG_PTR NumberOfPages, - PULONG_PTR PageArray OPTIONAL - ) -{ - STUB; - return 0; -} - -/* - * @unimplemented - */ -BOOL -WINAPI -MapUserPhysicalPagesScatter( - PVOID *VirtualAddresses, - ULONG_PTR NumberOfPages, - PULONG_PTR PageArray OPTIONAL ) { STUB; @@ -529,20 +468,6 @@ WINAPI RemoveVectoredExceptionHandler( PVOID VectoredHandlerHandle - ) -{ - STUB; - return 0; -} - -/* - * @unimplemented - */ -UINT -WINAPI -ResetWriteWatch( - LPVOID lpBaseAddress, - SIZE_T dwRegionSize ) { STUB; @@ -935,7 +860,7 @@ HANDLE WINAPI CreateSocketHandle(VOID) { STUB; - return 0; + return INVALID_HANDLE_VALUE; }
/* @@ -970,14 +895,10 @@ /* * @unimplemented */ -#if 0 -FARPROC WINAPI DelayLoadFailureHook(unsigned int dliNotify, PDelayLoadInfo pdli) -#else -FARPROC WINAPI DelayLoadFailureHook(unsigned int dliNotify, PVOID pdli) -#endif -{ - STUB; - return 0; +FARPROC WINAPI DelayLoadFailureHook(LPCSTR pszDllName, LPCSTR pszProcName) +{ + STUB; + return NULL; }
/*