Skip to content

Use Windows private namespace for kernel objects used in server-to-server IPC.#7213

Merged
hvlad merged 3 commits intomasterfrom
work/WinPrivateNS
Jun 20, 2022
Merged

Use Windows private namespace for kernel objects used in server-to-server IPC.#7213
hvlad merged 3 commits intomasterfrom
work/WinPrivateNS

Conversation

@hvlad
Copy link
Copy Markdown
Member

@hvlad hvlad commented Jun 17, 2022

It allows to synchronize processes across different windows sessions.

…rver IPC.

It allows to synchronize processes across different windows sessions.
@hvlad hvlad self-assigned this Jun 17, 2022
Comment thread src/common/utils.cpp Outdated
if (!CreateWellKnownSid(WinWorldSid, NULL, &sid, &cbSid))
raiseError("CreateWellKnownSid");

// Create security desctriptor which allows generic access to the just created SID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here: desctriptor -> descriptor

Comment thread src/common/utils.cpp Outdated

void init()
{
char sid[SECURITY_MAX_SID_SIZE];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be in the stack in unaligned location? Maybe some alignas should be used?

Here https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid I understand that AllocateAndInitializeSid would be needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here used CreateWellKnownSid() and I see no requirements for sid alignment.
Also, looking for usage samples one can see that its uses either LocalAlloc() or stack allocation.
Also, I see no notes about alignment of allocated by LocalAlloc() memory.

Anyway, I'll add alignas(SID) to be sure.

@hvlad hvlad merged commit 0c10243 into master Jun 20, 2022
@hvlad hvlad deleted the work/WinPrivateNS branch June 22, 2022 10:52
hvlad added a commit that referenced this pull request Apr 7, 2023
… objects used in server-to-server IPC.

Backport fix for bug #7535 : High CPU usage connect to Firebird 3 database using Firebird 4 Classic and SuperClassic service.
Implement new setting UseLegacyKernelObjectsNames for backward compatibility.
Preserve Win32 build compatibility with WinXP.
hvlad added a commit that referenced this pull request Apr 10, 2023
Backport improvement #7213 : Use Windows private namespace for kernel…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants