Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Kernel Shim Engine groundwork #2872

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

learn-more
Copy link
Member

@binarymaster binarymaster added the enhancement For PRs with an enhancement/new feature. label May 28, 2020
Copy link
Member

@ThFabba ThFabba left a comment

Choose a reason for hiding this comment

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

I don't suppose there's a simple shim we could add right away that would serve as an example? Would love to see how this code actually gets used.

Comment on lines +14 to +18
#define KseHookCallbackDriverInit 1
#define KseHookCallbackDriverStartIo 2
#define KseHookCallbackDriverUnload 3
#define KseHookCallbackAddDevice 4
#define KseHookCallbackMajorFunction 100
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to use enums for these?

Copy link
Member Author

Choose a reason for hiding this comment

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

mostly following existing style

ntoskrnl/include/internal/kse.h Outdated Show resolved Hide resolved
ntoskrnl/kse/kse.c Outdated Show resolved Hide resolved
ntoskrnl/kse/kse.c Outdated Show resolved Hide resolved
ntoskrnl/kse/kse.c Outdated Show resolved Hide resolved
ntoskrnl/kse/kse.c Outdated Show resolved Hide resolved
ntoskrnl/kse/kse.c Outdated Show resolved Hide resolved
sdk/include/ndk/iotypes.h Show resolved Hide resolved
sdk/tools/xml2sdb/xml2sdb.cpp Outdated Show resolved Hide resolved
return it.Tagid;
}
}
assert(false);
Copy link
Member

Choose a reason for hiding this comment

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

These are "it really should be impossible to get here" asserts, not "invalid user input" asserts, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

this one was mainly used while writing this, but it could mean invalid user input now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add some nice error messages in this tool on the next PR

@learn-more
Copy link
Member Author

I don't suppose there's a simple shim we could add right away that would serve as an example? Would love to see how this code actually gets used.

They are coming soon(tm).
This is just to provide a common starting ground for Hervé and me.

learn-more and others added 2 commits June 5, 2020 21:55
@@ -71,6 +71,13 @@ extern POBJECT_TYPE NTSYSAPI ExTimerType;
//
extern ULONG NTSYSAPI NtBuildNumber;


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

//
extern ULONG NTSYSAPI InitSafeBootMode;


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

* PROJECT: ReactOS Kernel
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: KSE 'VersionLie' shim implementation
* COPYRIGHT: Copyright 2020
Copy link
Contributor

Choose a reason for hiding this comment

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

?

}

static NTSTATUS NTAPI
KseShimDatabaseBootInitialize()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
KseShimDatabaseBootInitialize()
KseShimDatabaseBootInitialize(VOID)

}

static NTSTATUS NTAPI
KsepMatchInitMachineInfo()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
KsepMatchInitMachineInfo()
KsepMatchInitMachineInfo(VOID)

@tkreuzer
Copy link
Contributor

What do we need this for? I mean we don't even have a properly working kernel and you want to shim that? Sounds like hacks all the way down.

@learn-more
Copy link
Member Author

What do we need this for? I mean we don't even have a properly working kernel and you want to shim that? Sounds like hacks all the way down.

He wanted it mostly for logging what drivers are doing.
(One of the builtin shims has logging on the entrypoints)

@tkreuzer
Copy link
Contributor

He wanted it mostly for logging what drivers are doing.

Wouldn't driver verifier be better for that?

@binarymaster binarymaster added the kernel&hal Code changes to the ntoskrnl and HAL label Feb 7, 2021
@github-actions
Copy link

This PR is stale because it received no updates in the last 4 months. Without removing the stale label, or commenting on this ticket it will be closed in 2 weeks.

@github-actions github-actions bot added the no-pr-activity PRs with no further activity from the author. label Jun 16, 2022
@learn-more learn-more self-assigned this Jun 16, 2022
@learn-more learn-more removed the no-pr-activity PRs with no further activity from the author. label Jun 16, 2022
@binarymaster binarymaster added the needs rebase This PR needs to be rebased before merge label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For PRs with an enhancement/new feature. kernel&hal Code changes to the ntoskrnl and HAL needs rebase This PR needs to be rebased before merge
Projects
None yet
6 participants