Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ac49899e
Commit
ac49899e
authored
Aug 29, 2021
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Mar 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fltmgr.sys: Implement FltBuildDefaultSecurityDescriptor.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
parent
f2f453c4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
4 deletions
+63
-4
Makefile.in
dlls/fltmgr.sys/Makefile.in
+1
-0
fltmgr.sys.spec
dlls/fltmgr.sys/fltmgr.sys.spec
+2
-2
main.c
dlls/fltmgr.sys/main.c
+58
-1
fltkernel.h
include/ddk/fltkernel.h
+2
-1
No files found.
dlls/fltmgr.sys/Makefile.in
View file @
ac49899e
MODULE
=
fltmgr.sys
EXTRADLLFLAGS
=
-Wl
,--subsystem,native
IMPORTS
=
ntoskrnl
SOURCES
=
\
fltmgr.sys.spec
\
...
...
dlls/fltmgr.sys/fltmgr.sys.spec
View file @
ac49899e
...
...
@@ -10,7 +10,7 @@
@ stub FltAllocatePoolAlignedWithTag
@ stub FltAttachVolume
@ stub FltAttachVolumeAtAltitude
@ st
ub FltBuildDefaultSecurityDescriptor
@ st
dcall FltBuildDefaultSecurityDescriptor(ptr long)
@ stub FltCancelFileOpen
@ stub FltCancelIo
@ stub FltCbdqDisable
...
...
@@ -60,7 +60,7 @@
@ stub FltFreeFileLock
@ stub FltFreeGenericWorkItem
@ stub FltFreePoolAlignedWithTag
@ st
ub FltFreeSecurityDescriptor
@ st
dcall FltFreeSecurityDescriptor(ptr)
@ stub FltFsControlFile
@ stub FltGetBottomInstance
@ stub FltGetContexts
...
...
dlls/fltmgr.sys/main.c
View file @
ac49899e
...
...
@@ -23,7 +23,6 @@
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "ddk/fltkernel.h"
...
...
@@ -93,3 +92,61 @@ void* WINAPI FltGetRoutineAddress(LPCSTR name)
return
func
;
}
NTSTATUS
WINAPI
FltBuildDefaultSecurityDescriptor
(
PSECURITY_DESCRIPTOR
*
descriptor
,
ACCESS_MASK
access
)
{
PACL
dacl
;
NTSTATUS
ret
=
STATUS_INSUFFICIENT_RESOURCES
;
DWORD
sid_len
;
SID
*
sid
;
SID
*
sid_system
=
NULL
;
PSECURITY_DESCRIPTOR
sec_desc
=
NULL
;
SID_IDENTIFIER_AUTHORITY
auth
=
{
SECURITY_NULL_SID_AUTHORITY
};
*
descriptor
=
NULL
;
sid_len
=
RtlLengthRequiredSid
(
2
);
sid
=
ExAllocatePool
(
PagedPool
,
sid_len
);
if
(
!
sid
)
goto
done
;
RtlInitializeSid
(
sid
,
&
auth
,
2
);
sid
->
SubAuthority
[
1
]
=
DOMAIN_GROUP_RID_ADMINS
;
sid
->
SubAuthority
[
0
]
=
SECURITY_BUILTIN_DOMAIN_RID
;
sid_len
=
RtlLengthRequiredSid
(
1
);
sid_system
=
ExAllocatePool
(
PagedPool
,
sid_len
);
if
(
!
sid_system
)
goto
done
;
RtlInitializeSid
(
sid_system
,
&
auth
,
1
);
sid_system
->
SubAuthority
[
0
]
=
SECURITY_LOCAL_SYSTEM_RID
;
sid_len
=
SECURITY_DESCRIPTOR_MIN_LENGTH
+
sizeof
(
ACL
)
+
sizeof
(
ACCESS_ALLOWED_ACE
)
+
RtlLengthSid
(
sid
)
+
sizeof
(
ACCESS_ALLOWED_ACE
)
+
RtlLengthSid
(
sid_system
);
sec_desc
=
ExAllocatePool
(
PagedPool
,
sid_len
);
if
(
!
sec_desc
)
{
ret
=
STATUS_NO_MEMORY
;
goto
done
;
}
RtlCreateSecurityDescriptor
(
sec_desc
,
SECURITY_DESCRIPTOR_REVISION
);
dacl
=
(
PACL
)((
char
*
)
sec_desc
+
SECURITY_DESCRIPTOR_MIN_LENGTH
);
RtlCreateAcl
(
dacl
,
sid_len
-
SECURITY_DESCRIPTOR_MIN_LENGTH
,
ACL_REVISION
);
RtlAddAccessAllowedAce
(
dacl
,
ACL_REVISION
,
access
,
sid
);
RtlAddAccessAllowedAce
(
dacl
,
ACL_REVISION
,
access
,
sid_system
);
RtlSetDaclSecurityDescriptor
(
sec_desc
,
1
,
dacl
,
0
);
*
descriptor
=
sec_desc
;
ret
=
STATUS_SUCCESS
;
done:
ExFreePool
(
sid
);
ExFreePool
(
sid_system
);
return
ret
;
}
void
WINAPI
FltFreeSecurityDescriptor
(
PSECURITY_DESCRIPTOR
descriptor
)
{
ExFreePool
(
descriptor
);
}
include/ddk/fltkernel.h
View file @
ac49899e
...
...
@@ -653,7 +653,8 @@ typedef struct _FLT_REGISTRATION
PFLT_SECTION_CONFLICT_NOTIFICATION_CALLBACK
SectionNotificationCallback
;
}
FLT_REGISTRATION
,
*
PFLT_REGISTRATION
;
NTSTATUS
WINAPI
FltBuildDefaultSecurityDescriptor
(
PSECURITY_DESCRIPTOR
*
,
ACCESS_MASK
);
void
WINAPI
FltFreeSecurityDescriptor
(
PSECURITY_DESCRIPTOR
);
void
*
WINAPI
FltGetRoutineAddress
(
LPCSTR
name
);
NTSTATUS
WINAPI
FltRegisterFilter
(
PDRIVER_OBJECT
,
const
FLT_REGISTRATION
*
,
PFLT_FILTER
*
);
NTSTATUS
WINAPI
FltStartFiltering
(
PFLT_FILTER
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment