Skip to content

Commit

Permalink
Update to latest SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
dmex committed Dec 22, 2024
1 parent 300fa8d commit 3ee4b7d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions SystemInformer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ INT WINAPI wWinMain(

if (!PhMainWndInitialization(CmdShow))
{
PhShowError2(NULL, L"Unable to initialize the main window.", L"%s", L"");
PhShowStatus(NULL, L"Unable to create the window.", 0, ERROR_OUTOFMEMORY);
return 1;
}

Expand Down Expand Up @@ -999,8 +999,8 @@ BOOLEAN PhInitializeComPolicy(
PhLengthSid(&administratorsSid);

dacl = PTR_ADD_OFFSET(securityDescriptor, SECURITY_DESCRIPTOR_MIN_LENGTH);
RtlCreateSecurityDescriptor(securityDescriptor, SECURITY_DESCRIPTOR_REVISION);
RtlCreateAcl(dacl, securityDescriptorAllocationLength - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION);
PhCreateSecurityDescriptor(securityDescriptor, SECURITY_DESCRIPTOR_REVISION);
PhCreateAcl(dacl, securityDescriptorAllocationLength - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, FILE_READ_DATA | FILE_WRITE_DATA, &PhSeAuthenticatedUserSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, FILE_READ_DATA | FILE_WRITE_DATA, &PhSeLocalSystemSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, FILE_READ_DATA | FILE_WRITE_DATA, administratorsSid);
Expand Down
4 changes: 2 additions & 2 deletions SystemInformer/procprp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ INT CALLBACK PhpPropSheetProc(
PhInitializeLayoutManager(&propSheetContext->LayoutManager, hwndDlg);
PhSetWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT, propSheetContext);

propSheetContext->PropSheetWindowHookProc = (WNDPROC)GetWindowLongPtr(hwndDlg, GWLP_WNDPROC);
propSheetContext->PropSheetWindowHookProc = PhGetWindowProcedure(hwndDlg);
PhSetWindowContext(hwndDlg, 0xF, propSheetContext);
SetWindowLongPtr(hwndDlg, GWLP_WNDPROC, (LONG_PTR)PhpPropSheetWndProc);
PhSetWindowProcedure(hwndDlg, PhpPropSheetWndProc);

if (PhEnableThemeSupport) // NOTE: Required for compatibility. (dmex)
PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/runas.c
Original file line number Diff line number Diff line change
Expand Up @@ -2789,7 +2789,7 @@ INT_PTR CALLBACK PhpRunFileWndProc(
HDC hdc = (HDC)wParam;
RECT clientRect;

if (!GetClientRect(hwndDlg, &clientRect))
if (!PhGetClientRect(hwndDlg, &clientRect))
break;

SetBkMode(hdc, TRANSPARENT);
Expand Down
6 changes: 3 additions & 3 deletions phlib/kph.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ VOID KphSetServiceSecurity(
securityDescriptor = (PSECURITY_DESCRIPTOR)securityDescriptorBuffer;
dacl = PTR_ADD_OFFSET(securityDescriptor, SECURITY_DESCRIPTOR_MIN_LENGTH);

RtlCreateSecurityDescriptor(securityDescriptor, SECURITY_DESCRIPTOR_REVISION);
RtlCreateAcl(dacl, sdAllocationLength - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION);
PhCreateSecurityDescriptor(securityDescriptor, SECURITY_DESCRIPTOR_REVISION);
PhCreateAcl(dacl, sdAllocationLength - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, SERVICE_ALL_ACCESS, (PSID)&PhSeServiceSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, SERVICE_ALL_ACCESS, administratorsSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION,
Expand All @@ -347,7 +347,7 @@ VOID KphSetServiceSecurity(
DELETE,
(PSID)&PhSeInteractiveSid
);
RtlSetDaclSecurityDescriptor(securityDescriptor, TRUE, dacl, FALSE);
PhSetDaclSecurityDescriptor(securityDescriptor, TRUE, dacl, FALSE);

PhSetServiceObjectSecurity(ServiceHandle, DACL_SECURITY_INFORMATION, securityDescriptor);

Expand Down
4 changes: 2 additions & 2 deletions phlib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5198,7 +5198,7 @@ NTSTATUS PhFilterTokenForLimitedUser(

PhCreateSecurityDescriptor(&newSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION);

if (NT_SUCCESS(RtlSetDaclSecurityDescriptor(&newSecurityDescriptor, TRUE, newDacl, FALSE)))
if (NT_SUCCESS(PhSetDaclSecurityDescriptor(&newSecurityDescriptor, TRUE, newDacl, FALSE)))
PhSetObjectSecurity(newTokenHandle, DACL_SECURITY_INFORMATION, &newSecurityDescriptor);

// Set the default DACL.
Expand Down Expand Up @@ -7665,7 +7665,7 @@ HANDLE PhGetNamespaceHandle(
RtlAddAccessAllowedAce(dacl, ACL_REVISION, DIRECTORY_ALL_ACCESS, (PSID)&PhSeLocalSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, DIRECTORY_ALL_ACCESS, administratorsSid);
RtlAddAccessAllowedAce(dacl, ACL_REVISION, DIRECTORY_QUERY | DIRECTORY_TRAVERSE | DIRECTORY_CREATE_OBJECT, (PSID)&PhSeInteractiveSid);
RtlSetDaclSecurityDescriptor(securityDescriptor, TRUE, dacl, FALSE);
PhSetDaclSecurityDescriptor(securityDescriptor, TRUE, dacl, FALSE);

RtlInitUnicodeString(&objectName, L"\\BaseNamedObjects\\SystemInformer");
InitializeObjectAttributes(
Expand Down
40 changes: 20 additions & 20 deletions tools/peview/clrtableimports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,43 +118,43 @@ PPH_STRING PvClrImportFlagsToString(
PhInitializeStringBuilder(&stringBuilder, 10);

if (IsPmNoMangle(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"No mangle, "));
PhAppendStringBuilder2(&stringBuilder, L"No mangle, ");
if (IsPmCharSetAnsi(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Ansi charset, "));
PhAppendStringBuilder2(&stringBuilder, L"Ansi charset, ");
if (IsPmCharSetUnicode(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Unicode charset, "));
PhAppendStringBuilder2(&stringBuilder, L"Unicode charset, ");
if (IsPmCharSetAuto(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Auto charset, "));
PhAppendStringBuilder2(&stringBuilder, L"Auto charset, ");
if (IsPmSupportsLastError(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Supports last error, "));
PhAppendStringBuilder2(&stringBuilder, L"Supports last error, ");
if (IsPmCallConvWinapi(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Winapi, "));
PhAppendStringBuilder2(&stringBuilder, L"Winapi, ");
if (IsPmCallConvCdecl(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Cdecl, "));
PhAppendStringBuilder2(&stringBuilder, L"Cdecl, ");
if (IsPmCallConvStdcall(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Stdcall, "));
PhAppendStringBuilder2(&stringBuilder, L"Stdcall, ");
if (IsPmCallConvThiscall(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Thiscall, "));
PhAppendStringBuilder2(&stringBuilder, L"Thiscall, ");
if (IsPmCallConvFastcall(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Fastcall, "));
PhAppendStringBuilder2(&stringBuilder, L"Fastcall, ");
if (IsPmBestFitEnabled(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Bestfit enabled, "));
PhAppendStringBuilder2(&stringBuilder, L"Bestfit enabled, ");
if (IsPmBestFitDisabled(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Bestfit disabled, "));
PhAppendStringBuilder2(&stringBuilder, L"Bestfit disabled, ");
if (IsPmBestFitUseAssem(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"Bestfit assembly, "));
PhAppendStringBuilder2(&stringBuilder, L"Bestfit assembly, ");
if (IsPmThrowOnUnmappableCharEnabled(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"ThrowOnUnmappableChar enabled, "));
PhAppendStringBuilder2(&stringBuilder, L"ThrowOnUnmappableChar enabled, ");
if (IsPmThrowOnUnmappableCharDisabled(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"ThrowOnUnmappableChar disabled, "));
PhAppendStringBuilder2(&stringBuilder, L"ThrowOnUnmappableChar disabled, ");
if (IsPmThrowOnUnmappableCharUseAssem(Flags))
PhAppendStringBuilder2(&stringBuilder, const_cast<wchar_t*>(L"ThrowOnUnmappableChar assembly, "));
PhAppendStringBuilder2(&stringBuilder, L"ThrowOnUnmappableChar assembly, ");

if (PhEndsWithString2(stringBuilder.String, const_cast<wchar_t*>(L", "), FALSE))
if (PhEndsWithString2(stringBuilder.String, L", ", FALSE))
PhRemoveEndStringBuilder(&stringBuilder, 2);

PhPrintPointer(pointer, UlongToPtr(Flags));
PhAppendFormatStringBuilder(&stringBuilder, const_cast<wchar_t*>(L" (%s)"), pointer);
PhAppendFormatStringBuilder(&stringBuilder, L" (%s)", pointer);

return PhFinalStringBuilderString(&stringBuilder);
}
Expand Down Expand Up @@ -729,7 +729,7 @@ EXTERN_C HRESULT PvGetClrImageImports(
PPV_CLR_IMAGE_IMPORT_FUNCTION importFunction;

importFunction = static_cast<PPV_CLR_IMAGE_IMPORT_FUNCTION>(PhAllocateZero(sizeof(PV_CLR_IMAGE_IMPORT_FUNCTION)));
importFunction->FunctionName = PhConvertUtf8ToUtf16(const_cast<char*>(importName));
importFunction->FunctionName = PhConvertUtf8ToUtf16(importName);
importFunction->Flags = importFlagsValue;
importFunction->Offset = importOffsetValue;

Expand All @@ -755,7 +755,7 @@ EXTERN_C HRESULT PvGetClrImageImports(
PPV_CLR_IMAGE_IMPORT_FUNCTION importFunction;

importFunction = static_cast<PPV_CLR_IMAGE_IMPORT_FUNCTION>(PhAllocateZero(sizeof(PV_CLR_IMAGE_IMPORT_FUNCTION)));
importFunction->FunctionName = PhConvertUtf8ToUtf16(const_cast<char*>(importName));
importFunction->FunctionName = PhConvertUtf8ToUtf16(importName);
importFunction->Flags = importFlagsValue;
importFunction->Offset = importOffsetValue;

Expand Down

0 comments on commit 3ee4b7d

Please sign in to comment.