Skip to content

Commit

Permalink
Version 2.10.0. Updated advapi32_wrapper, crytext_wrapper, Kernelbase…
Browse files Browse the repository at this point in the history
…_wrapper, ntext_wrapper, user32_wrapper and ws2_32_wrapper
  • Loading branch information
Skulltrail192 committed Oct 5, 2022
1 parent 0b29072 commit f2aff16
Show file tree
Hide file tree
Showing 19 changed files with 239 additions and 178 deletions.
2 changes: 1 addition & 1 deletion wrappers/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_subdirectory(advapi32_wrapper)
add_subdirectory(browseui_wrapper)
add_subdirectory(comdlg32_wrapper)
add_subdirectory(crypt32_wrapper)
add_subdirectory(cryptext_wrapper)
add_subdirectory(gdi32_wrapper)
add_subdirectory(iphlpapi_wrapper)
add_subdirectory(kernelbase_wrapper)
Expand Down
40 changes: 20 additions & 20 deletions wrappers/base/advapi32_wrapper/advapi32_wrapper.spec
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
125 stdcall CredUnmarshalCredentialA(str ptr ptr)
126 stdcall CredUnmarshalCredentialW(wstr ptr ptr)
127 stdcall CredWriteA(ptr long)
128 stdcall CredWriteDomainCredentialsA(ptr ptr long) advapibase.CredWriteDomainCredentialsA
128 stdcall CredWriteDomainCredentialsA(ptr ptr long) advapibase.CredWriteDomainCredentialsA ;for reactos
129 stdcall CredWriteDomainCredentialsW(ptr ptr long)
130 stdcall CredWriteW(ptr long)
131 stdcall CredpConvertCredential(long long long ptr)
Expand Down Expand Up @@ -230,7 +230,7 @@
237 stdcall GetEffectiveRightsFromAclA(ptr ptr ptr)
238 stdcall GetEffectiveRightsFromAclW(ptr ptr ptr)
239 stdcall GetEventLogInformation(long long ptr long ptr)
240 stdcall GetExplicitEntriesFromAclA(ptr ptr ptr) advapi32.GetExplicitEntriesFromAclW
240 stdcall GetExplicitEntriesFromAclA(ptr ptr ptr) advapibase.GetExplicitEntriesFromAclW
241 stdcall GetExplicitEntriesFromAclW(ptr ptr ptr)
242 stdcall GetFileSecurityA(str long ptr long ptr)
243 stdcall GetFileSecurityW(wstr long ptr long ptr)
Expand Down Expand Up @@ -574,27 +574,27 @@
601 stdcall SystemFunction008(ptr ptr ptr)
602 stdcall SystemFunction009(ptr ptr ptr)
603 stdcall SystemFunction010(ptr ptr ptr)
604 stdcall SystemFunction011(ptr ptr ptr) SystemFunction010
604 stdcall SystemFunction011(ptr ptr ptr)
605 stdcall SystemFunction012(ptr ptr ptr)
606 stdcall SystemFunction013(ptr ptr ptr)
607 stdcall SystemFunction014(ptr ptr ptr) SystemFunction012
608 stdcall SystemFunction015(ptr ptr ptr) SystemFunction013
609 stdcall SystemFunction016(ptr ptr ptr) SystemFunction012
610 stdcall SystemFunction017(ptr ptr ptr) SystemFunction013
611 stdcall SystemFunction018(ptr ptr ptr) SystemFunction012
612 stdcall SystemFunction019(ptr ptr ptr) SystemFunction013
613 stdcall SystemFunction020(ptr ptr ptr) SystemFunction012
614 stdcall SystemFunction021(ptr ptr ptr) SystemFunction013
615 stdcall SystemFunction022(ptr ptr ptr) SystemFunction012
616 stdcall SystemFunction023(ptr ptr ptr) SystemFunction013
607 stdcall SystemFunction014(ptr ptr ptr)
608 stdcall SystemFunction015(ptr ptr ptr)
609 stdcall SystemFunction016(ptr ptr ptr)
610 stdcall SystemFunction017(ptr ptr ptr)
611 stdcall SystemFunction018(ptr ptr ptr)
612 stdcall SystemFunction019(ptr ptr ptr)
613 stdcall SystemFunction020(ptr ptr ptr)
614 stdcall SystemFunction021(ptr ptr ptr)
615 stdcall SystemFunction022(ptr ptr ptr)
616 stdcall SystemFunction023(ptr ptr ptr)
617 stdcall SystemFunction024(ptr ptr ptr)
618 stdcall SystemFunction025(ptr ptr ptr)
619 stdcall SystemFunction026(ptr ptr ptr) SystemFunction024
620 stdcall SystemFunction027(ptr ptr ptr) SystemFunction025
619 stdcall SystemFunction026(ptr ptr ptr)
620 stdcall SystemFunction027(ptr ptr ptr)
621 stdcall SystemFunction028(long long)
622 stdcall SystemFunction029(long long)
623 stdcall SystemFunction030(ptr ptr)
624 stdcall SystemFunction031(ptr ptr) SystemFunction030
624 stdcall SystemFunction031(ptr ptr)
625 stdcall SystemFunction032(ptr ptr)
626 stdcall SystemFunction033(long long)
627 stdcall SystemFunction034(long long)
Expand Down Expand Up @@ -678,7 +678,7 @@
486 stdcall RegGetValueA(long str str long ptr ptr ptr)
487 stdcall RegGetValueW(long wstr wstr long ptr ptr ptr)

;@ stdcall LogonUserExExW(str str str long long ptr ptr ptr ptr ptr ptr)
; @ stdcall LogonUserExExW(str str str long long ptr ptr ptr ptr ptr ptr)

#Vista Functions implemented (without redirection)
@ stdcall AddMandatoryAce(ptr long long long ptr)
Expand Down Expand Up @@ -869,12 +869,12 @@

#Hooks
87 stdcall ConvertStringSecurityDescriptorToSecurityDescriptorA(str long ptr ptr)
88 stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr) ConvertStringSecurityDescriptorToSecurityDescriptorWInternal
88 stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr) ;ConvertStringSecurityDescriptorToSecurityDescriptorWInternal
89 stdcall ConvertStringSidToSidA(ptr ptr)
90 stdcall ConvertStringSidToSidW(ptr ptr) ConvertStringSidToSidWInternal
90 stdcall ConvertStringSidToSidW(ptr ptr) ;ConvertStringSidToSidWInternal
101 stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) CreateRestrictedTokenInternal
248 stdcall GetKernelObjectSecurity(long long ptr long ptr) GetKernelObjectSecurityInternal
261 stdcall GetNamedSecurityInfoW(wstr long long ptr ptr ptr ptr ptr) ;GetNamedSecurityInfoWInternal
261 stdcall GetNamedSecurityInfoW(wstr long long ptr ptr ptr ptr ptr) GetNamedSecurityInfoWInternal
273 stdcall GetSecurityInfo(long long long ptr ptr ptr ptr ptr) GetSecurityInfoInternal
284 stdcall GetTokenInformation(ptr long ptr long ptr) GetTokenInformationInternal
429 stdcall OpenProcessToken(long long ptr) OpenProcessTokenInternal
Expand Down
20 changes: 10 additions & 10 deletions wrappers/base/advapi32_wrapper/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ Revision History:

WINE_DEFAULT_DEBUG_CHANNEL(advapi32_hooks);

/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW (sechost.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescriptorW(
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescriptorExW(
const WCHAR *string, DWORD revision, PSECURITY_DESCRIPTOR *sd, ULONG *ret_size );

BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidW( const WCHAR *string, PSID *sid );
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidExW( const WCHAR *string, PSID *sid );

BOOL
APIENTRY
Expand Down Expand Up @@ -444,7 +441,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescripto
{
BOOL resp;

resp = ConvertStringSecurityDescriptorToSecurityDescriptorW(string,
resp = ConvertStringSecurityDescriptorToSecurityDescriptorExW(string,
revision,
sd,
ret_size);
Expand All @@ -453,16 +450,19 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescripto
DbgPrint("ConvertStringSecurityDescriptorToSecurityDescriptorWInternal::ConvertStringSecurityDescriptorToSecurityDescriptorW resp: %d\n", resp);
}

return TRUE;
return resp;
}

BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidWInternal( const WCHAR *string, PSID *sid )
BOOL
WINAPI
DECLSPEC_HOTPATCH
ConvertStringSidToSidWInternal( const WCHAR *string, PSID *sid )
{
BOOL ret;

ret = ConvertStringSidToSidW(string, sid);
ret = ConvertStringSidToSidExW(string, sid);

DbgPrint("ConvertStringSidToSidWInternal:: ConvertStringSidToSidW return: %d\n", ret);

return TRUE;
return ret;
}
9 changes: 6 additions & 3 deletions wrappers/base/advapi32_wrapper/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ static BOOL parse_sd( const WCHAR *string, SECURITY_DESCRIPTOR_RELATIVE *sd, DWO
/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW (sechost.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescriptorW(
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescriptorExW(
const WCHAR *string, DWORD revision, PSECURITY_DESCRIPTOR *sd, ULONG *ret_size )
{
DWORD size;
Expand Down Expand Up @@ -889,7 +889,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSecurityDescriptorToSecurityDescripto
/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorA [ADVAPI32.@]
*/
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA(
BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorExA(
LPCSTR StringSecurityDescriptor,
DWORD StringSDRevision,
PSECURITY_DESCRIPTOR* SecurityDescriptor,
Expand All @@ -916,7 +916,10 @@ BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA(
/******************************************************************************
* ConvertStringSidToSidW (sechost.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH ConvertStringSidToSidW( const WCHAR *string, PSID *sid )
BOOL
WINAPI
DECLSPEC_HOTPATCH
ConvertStringSidToSidExW( const WCHAR *string, PSID *sid )
{
DWORD size;
const WCHAR *string_end;
Expand Down
18 changes: 0 additions & 18 deletions wrappers/base/crypt32_wrapper/CMakeLists.txt

This file was deleted.

18 changes: 18 additions & 0 deletions wrappers/base/cryptext_wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

spec2def(cryptext_wrapper.dll cryptext_wrapper.spec)

list(APPEND SOURCE
main.c
version.rc
${CMAKE_CURRENT_BINARY_DIR}/cryptext_wrapper_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/cryptext_wrapper.def)

add_library(cryptext_wrapper SHARED ${SOURCE})
set_module_type(cryptext_wrapper win32dll ENTRYPOINT 0)
add_importlibs(cryptext_wrapper pdhbase msvcrt kernel32 ntdll)
target_link_libraries(cryptext_wrapper wine)
add_cd_file(TARGET cryptext_wrapper DESTINATION reactos/system32 FOR all)

spec2def(cryptext_wrapper.dll cryptext_wrapper.spec)


File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions wrappers/base/kernelbase_wrapper/kernelbase.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,8 @@
@ stdcall SetProcessGroupAffinity(long ptr ptr)

; #Win10 functions
; @ stdcall GetThreadDescription(long ptr)
; @ stdcall SetThreadDescription(long ptr)
@ stdcall GetThreadDescription(long ptr)
@ stdcall SetThreadDescription(long ptr)
@ stdcall AppPolicyGetMediaFoundationCodecLoading(ptr ptr)
@ stdcall IsWow64Process2(ptr ptr ptr)

Expand Down
115 changes: 58 additions & 57 deletions wrappers/base/kernelbase_wrapper/synch.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,64 +752,65 @@ BOOL getQueuedCompletionStatus(
&lpEnt->lpOverlapped, dwMilliseconds);
}

// BOOL WINAPI GetQueuedCompletionStatusEx(
// HANDLE CompletionPort,
// LPOVERLAPPED_ENTRY lpCompletionPortEntries,
// ULONG ulCount,
// PULONG ulNumEntriesRemoved,
// DWORD dwMilliseconds,
// BOOL fAlertable
// )
// {
// int i;
// LARGE_INTEGER time;
// NTSTATUS Status;
// // validate arguments
// if(!lpCompletionPortEntries
// || !ulCount || !ulNumEntriesRemoved) {
// RtlSetLastWin32Error(ERROR_INVALID_PARAMETER);
// return FALSE; }

// // partial implementation error
// if(fAlertable)
// DbgPrint("GetQueuedCompletionStatusEx: fAlertable");

// // retrieve multiple entries

// for(i = 0;i < ulCount; i++)
// {
// if(!getQueuedCompletionStatus(CompletionPort,
// lpCompletionPortEntries+i, dwMilliseconds))
// {
// break;
// }
BOOL
WINAPI
GetQueuedCompletionStatusEx(
HANDLE CompletionPort,
LPOVERLAPPED_ENTRY lpCompletionPortEntries,
ULONG ulCount,
PULONG ulNumEntriesRemoved,
DWORD dwMilliseconds,
BOOL fAlertable
) {
int i = 0;
// validate arguments
if(!lpCompletionPortEntries
|| !ulCount || !ulNumEntriesRemoved) {
RtlSetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE; }

//DbgPrint("GetQueuedCompletionStatusEx: fAlertable");

// Status = NtWaitForSingleObject( CompletionPort, fAlertable, get_nt_timeout( &time, dwMilliseconds ) );
// if (Status != WAIT_OBJECT_0) break;
// //dwMilliseconds = 0;
// }

// *ulNumEntriesRemoved = i;
// return TRUE;
// }

/******************************************************************************
* GetQueuedCompletionStatusEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetQueuedCompletionStatusEx( HANDLE port, OVERLAPPED_ENTRY *entries,
ULONG count, ULONG *written,
DWORD timeout, BOOL alertable )
{
LARGE_INTEGER time;
NTSTATUS ret;
// retrieve multiple entries
for(i = 0;i < ulCount; i++)
{
if(!getQueuedCompletionStatus(CompletionPort,
lpCompletionPortEntries+i, dwMilliseconds)) break;
dwMilliseconds = 0;
}

TRACE( "%p %p %lu %p %lu %u\n", port, entries, count, written, timeout, alertable );
*ulNumEntriesRemoved = i;

ret = NtRemoveIoCompletionEx( port, (FILE_IO_COMPLETION_INFORMATION *)entries, count,
written, get_nt_timeout( &time, timeout ), alertable );
if (ret == STATUS_SUCCESS) return TRUE;
else if (ret == STATUS_TIMEOUT) SetLastError( WAIT_TIMEOUT );
else if (ret == STATUS_USER_APC) SetLastError( WAIT_IO_COMPLETION );
else SetLastError( RtlNtStatusToDosError(ret) );
return FALSE;
// partial implementation error
if(fAlertable){
if ( WaitForSingleObjectEx(CompletionPort, dwMilliseconds, TRUE) == WAIT_OBJECT_0) {
//WDM_DEBUG("Exiting the monitoring thread!");
ExitThread(0);
}
}else{
WaitForSingleObject(CompletionPort, dwMilliseconds);
}

return !!i;
}

// /******************************************************************************
// * GetQueuedCompletionStatusEx (kernelbase.@)
// */
// BOOL WINAPI DECLSPEC_HOTPATCH GetQueuedCompletionStatusEx( HANDLE port, OVERLAPPED_ENTRY *entries,
// ULONG count, ULONG *written,
// DWORD timeout, BOOL alertable )
// {
// LARGE_INTEGER time;
// NTSTATUS ret;

// TRACE( "%p %p %lu %p %lu %u\n", port, entries, count, written, timeout, alertable );

// ret = NtRemoveIoCompletionEx( port, (FILE_IO_COMPLETION_INFORMATION *)entries, count,
// written, get_nt_timeout( &time, timeout ), alertable );
// if (ret == STATUS_SUCCESS) return TRUE;
// else if (ret == STATUS_TIMEOUT) SetLastError( WAIT_TIMEOUT );
// else if (ret == STATUS_USER_APC) SetLastError( WAIT_IO_COMPLETION );
// else SetLastError( RtlNtStatusToDosError(ret) );
// return FALSE;
// }
37 changes: 17 additions & 20 deletions wrappers/base/ntext_wrapper/rtl/context.c
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
Copyright (c) 2015 Microsoft Corporation
/*++
Copyright (c) 2022 Shorthorn Project
Module Name:
cnvint.c
*/
xstate.c
Abstract:
This module implements Context of Xstate
Author:
Skulltrail 26-September-2022
Revision History:
--*/

#define NDEBUG

Expand Down
Loading

0 comments on commit f2aff16

Please sign in to comment.