2005-06-26 21:01:19 +00:00
|
|
|
/*
|
2005-02-17 12:45:13 +00:00
|
|
|
* reactos/subsys/system/lsass/lsass.c
|
2005-05-08 04:07:56 +00:00
|
|
|
*
|
1999-07-17 23:10:31 +00:00
|
|
|
* ReactOS Operating System
|
2005-05-08 04:07:56 +00:00
|
|
|
*
|
1999-07-17 23:10:31 +00:00
|
|
|
* --------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* This software is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software 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
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this software; see the file COPYING.LIB. If not, write
|
|
|
|
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
2005-05-08 04:07:56 +00:00
|
|
|
* MA 02139, USA.
|
1999-07-17 23:10:31 +00:00
|
|
|
*
|
|
|
|
* --------------------------------------------------------------------
|
2005-05-08 04:07:56 +00:00
|
|
|
*
|
1999-07-17 23:10:31 +00:00
|
|
|
* 19990704 (Emanuele Aliberti)
|
|
|
|
* Compiled successfully with egcs 1.1.2
|
|
|
|
*/
|
2005-10-19 17:03:38 +00:00
|
|
|
#define WIN32_NO_STATUS
|
2005-02-17 15:10:55 +00:00
|
|
|
#include <windows.h>
|
2005-06-26 21:01:19 +00:00
|
|
|
#define NTOS_MODE_USER
|
2005-06-26 05:04:12 +00:00
|
|
|
#include <ndk/ntndk.h>
|
2005-06-26 21:01:19 +00:00
|
|
|
|
2005-02-17 12:45:13 +00:00
|
|
|
#include <lsass/lsasrv.h>
|
2005-06-26 21:01:19 +00:00
|
|
|
//#include <samsrv.h>
|
|
|
|
#include <lsass/lsass.h>
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2005-02-17 12:45:13 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
static VOID CALLBACK
|
|
|
|
ServiceMain(DWORD argc, LPTSTR *argv);
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
static SERVICE_TABLE_ENTRY ServiceTable[2] =
|
1999-07-17 23:10:31 +00:00
|
|
|
{
|
2006-10-09 19:16:47 +00:00
|
|
|
{TEXT("NetLogon"), ServiceMain},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
static VOID CALLBACK
|
|
|
|
ServiceMain(
|
|
|
|
IN DWORD argc,
|
|
|
|
IN LPWSTR *argv)
|
|
|
|
{
|
- Fix SleepEx.
- Put volatile statements in EX_RUNDOWN_REF, IRP, DEVICE_OBJECT, ERESOURCE, FILE_OBJECT, IO_REMOVE_LOCK, WORK_QUEUE_ITEM where required (thanks to Microsoft's changes in the WDK to mark the fields properly).
- Update FILE_OBJECT definition.
- Add some asserts to some I/O functions.
- Add stub support for File Objects created by XP+ Drivers which have File Object Extensions.
- Add some fixes to IopDeleteFile, including proper reference counting for the DO and VPB, as well as cleanup when the file is closed without a handle.
- Fix a bug in IopSecurityFile.
- Queue and unqueue IRPs in all I/O functions.
- Fully support IRP cancellation now.
- Fix critical bugs in NtDeviceIoControlFile and NtDeviceFsControlFile which were causing double queueing of IRPs and freeing of invalid memory, as well as invalid paramter checking for user-mode buffers.
- Add exhaustive validation checks to IoCreateFile, add more failure cases, and validate the EA buffer. Also support IO_ATTACH_DEVICE_API flag.
- Implement IoCreateStreamFileObjectEx and IoCreateStreamFileObjectLite and fix several bugs in the original implementation of IoCreateStreamFileObject.
- Fix a bug in RtlRaiseException.
- Update Io*ShareAccess routines to support XP+ style semantics related to special File Object flags which disable their use.
- Add validation to all Query/Set routines so that information clasess, lengths, buffers and alignment are properly checked.
- Also add an array for the proper acess rights that each query/set operation requires.
- Check backup/restore privileges during I/O File operations.
- Check traverse access during I/O File Operations.
- Check access privileges to the device during I/O file operations.
- Rename IopReferenceDeviceObject and also verify if an exclusive DO is trying to be invalidly opened.
- Support various extra security checks during I/O File/Device Parse Routine.
- Fix a bug during IopCleanupIrp so that we don't dereference the File OBject if this was a create operation.
- Fix some bogus asserts in IofCompleteRequest, and save the IRP Flags before signalling it's event, since the driver might've freed it behind our back.
- Fix a large bug in ObInsertObject which affected the insert of unnamed objects with forced security options (Such as process/threads).
- Fix the creation of the Process/Thread/Job Obejct Types to that security information is forced.
- Remove "Fix PS!!!" messages since the bug is now fixed and these objects now get proper security descriptors.
- Fix another bug in ObInsertObjet which wasn't properly validating user-mode objects and always assumed kernel mode.
- Silence multiple trace/checkpoint messages that have accumulated throughout time for various debugging purposes.
svn path=/trunk/; revision=25118
2006-12-10 18:40:30 +00:00
|
|
|
DPRINT("ServiceMain() called\n");
|
2006-10-09 19:16:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
INT WINAPI
|
2008-05-08 18:26:15 +00:00
|
|
|
wWinMain(
|
2006-10-09 19:16:47 +00:00
|
|
|
IN HINSTANCE hInstance,
|
|
|
|
IN HINSTANCE hPrevInstance,
|
2008-05-08 18:26:15 +00:00
|
|
|
IN LPWSTR lpCmdLine,
|
2006-10-09 19:16:47 +00:00
|
|
|
IN INT nShowCmd)
|
|
|
|
{
|
|
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
|
|
|
|
DPRINT("Local Security Authority Subsystem\n");
|
|
|
|
DPRINT(" Initializing...\n");
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
/* Initialize the LSA server DLL. */
|
|
|
|
Status = LsapInitLsa();
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("LsapInitLsa() failed (Status 0x%08lX)\n", Status);
|
|
|
|
goto ByeBye;
|
|
|
|
}
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2005-06-26 21:01:19 +00:00
|
|
|
#if 0
|
2006-10-09 19:16:47 +00:00
|
|
|
/* Initialize the SAM server DLL. */
|
|
|
|
Status = SamIInitialize();
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("SamIInitialize() failed (Status 0x%08lX)\n", Status);
|
|
|
|
goto ByeBye;
|
|
|
|
}
|
2005-06-26 21:01:19 +00:00
|
|
|
#endif
|
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
/* FIXME: More initialization */
|
|
|
|
|
|
|
|
StartServiceCtrlDispatcher(ServiceTable);
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
DPRINT(" Done...\n");
|
2005-06-26 21:01:19 +00:00
|
|
|
|
2005-02-17 12:45:13 +00:00
|
|
|
ByeBye:
|
2006-10-09 19:16:47 +00:00
|
|
|
NtTerminateThread(NtCurrentThread(), Status);
|
1999-07-17 23:10:31 +00:00
|
|
|
|
2006-10-09 19:16:47 +00:00
|
|
|
return 0;
|
1999-07-17 23:10:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|