reactos/base/system/lsass/lsass.c

100 lines
2.2 KiB
C
Raw Normal View History

/*
* reactos/subsys/system/lsass/lsass.c
*
1999-07-17 23:10:31 +00:00
* ReactOS Operating System
*
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,
* MA 02139, USA.
1999-07-17 23:10:31 +00:00
*
* --------------------------------------------------------------------
*
1999-07-17 23:10:31 +00:00
* 19990704 (Emanuele Aliberti)
* Compiled successfully with egcs 1.1.2
*/
#define WIN32_NO_STATUS
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
#include <lsass/lsasrv.h>
//#include <samsrv.h>
#include <lsass/lsass.h>
1999-07-17 23:10:31 +00:00
#define NDEBUG
#include <debug.h>
1999-07-17 23:10:31 +00:00
static VOID CALLBACK
ServiceMain(DWORD argc, LPTSTR *argv);
1999-07-17 23:10:31 +00:00
static SERVICE_TABLE_ENTRY ServiceTable[2] =
1999-07-17 23:10:31 +00:00
{
{TEXT("NetLogon"), ServiceMain},
{NULL, NULL}
};
1999-07-17 23:10:31 +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");
}
INT WINAPI
wWinMain(
IN HINSTANCE hInstance,
IN HINSTANCE hPrevInstance,
IN LPWSTR lpCmdLine,
IN INT nShowCmd)
{
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("Local Security Authority Subsystem\n");
DPRINT(" Initializing...\n");
1999-07-17 23:10:31 +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
#if 0
/* Initialize the SAM server DLL. */
Status = SamIInitialize();
if (!NT_SUCCESS(Status))
{
DPRINT1("SamIInitialize() failed (Status 0x%08lX)\n", Status);
goto ByeBye;
}
#endif
/* FIXME: More initialization */
StartServiceCtrlDispatcher(ServiceTable);
1999-07-17 23:10:31 +00:00
DPRINT(" Done...\n");
ByeBye:
NtTerminateThread(NtCurrentThread(), Status);
1999-07-17 23:10:31 +00:00
return 0;
1999-07-17 23:10:31 +00:00
}
/* EOF */