2003-05-18 17:16:18 +00:00
|
|
|
/*
|
|
|
|
* ReactOS W32 Subsystem
|
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program 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 program 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 program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2003-07-11 15:59:37 +00:00
|
|
|
/* $Id: loader.c,v 1.11 2003/07/11 15:59:37 royce Exp $
|
2000-08-26 16:22:04 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
#include <ddk/ntddk.h>
|
2000-03-08 21:23:14 +00:00
|
|
|
#include <ddk/winddi.h>
|
|
|
|
|
2003-07-11 15:59:37 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2000-03-08 22:37:04 +00:00
|
|
|
HANDLE
|
|
|
|
STDCALL
|
|
|
|
EngLoadImage (LPWSTR DriverName)
|
2000-03-08 21:23:14 +00:00
|
|
|
{
|
2002-06-14 07:49:58 +00:00
|
|
|
SYSTEM_LOAD_IMAGE GdiDriverInfo;
|
2001-03-31 15:35:08 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
|
2002-06-14 07:49:58 +00:00
|
|
|
RtlInitUnicodeString(&GdiDriverInfo.ModuleName, DriverName);
|
|
|
|
Status = ZwSetSystemInformation(SystemLoadImage, &GdiDriverInfo, sizeof(SYSTEM_LOAD_IMAGE));
|
2001-03-31 15:35:08 +00:00
|
|
|
if (!NT_SUCCESS(Status)) return NULL;
|
|
|
|
|
2002-06-14 07:49:58 +00:00
|
|
|
return (HANDLE)GdiDriverInfo.ModuleBase;
|
2000-03-08 21:23:14 +00:00
|
|
|
}
|
2000-06-16 07:25:41 +00:00
|
|
|
|
2000-08-26 16:22:04 +00:00
|
|
|
|
2003-07-11 15:59:37 +00:00
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2000-06-16 07:25:41 +00:00
|
|
|
HANDLE
|
|
|
|
STDCALL
|
|
|
|
EngLoadModule(LPWSTR ModuleName)
|
|
|
|
{
|
2002-06-14 07:49:58 +00:00
|
|
|
SYSTEM_LOAD_IMAGE GdiDriverInfo;
|
2001-03-31 15:35:08 +00:00
|
|
|
NTSTATUS Status;
|
2000-08-26 16:22:04 +00:00
|
|
|
|
2001-03-31 15:35:08 +00:00
|
|
|
// FIXME: should load as readonly
|
2000-08-26 16:22:04 +00:00
|
|
|
|
2002-06-14 07:49:58 +00:00
|
|
|
RtlInitUnicodeString (&GdiDriverInfo.ModuleName, ModuleName);
|
|
|
|
Status = ZwSetSystemInformation (SystemLoadImage, &GdiDriverInfo, sizeof(SYSTEM_LOAD_IMAGE));
|
2001-03-31 15:35:08 +00:00
|
|
|
if (!NT_SUCCESS(Status)) return NULL;
|
2000-08-26 16:22:04 +00:00
|
|
|
|
2002-06-14 07:49:58 +00:00
|
|
|
return (HANDLE)GdiDriverInfo.ModuleBase;
|
2000-06-16 07:25:41 +00:00
|
|
|
}
|
2000-08-26 16:22:04 +00:00
|
|
|
|
|
|
|
/* EOF */
|