Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/ntoskrnl.exe/tests/Makefile.in | 4 ++++ dlls/ntoskrnl.exe/tests/driver3.c | 31 ++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/tests/driver3.spec | 1 + dlls/ntoskrnl.exe/tests/ntoskrnl.c | 22 ++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 dlls/ntoskrnl.exe/tests/driver3.c create mode 100644 dlls/ntoskrnl.exe/tests/driver3.spec
diff --git a/dlls/ntoskrnl.exe/tests/Makefile.in b/dlls/ntoskrnl.exe/tests/Makefile.in index fae11bb703..7946b8de22 100644 --- a/dlls/ntoskrnl.exe/tests/Makefile.in +++ b/dlls/ntoskrnl.exe/tests/Makefile.in @@ -5,10 +5,14 @@ driver_IMPORTS = winecrt0 ntoskrnl driver_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native driver2_IMPORTS = winecrt0 ntoskrnl driver2_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native +driver3_IMPORTS = winecrt0 ntoskrnl +driver3_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
SOURCES = \ driver.c \ driver.spec \ driver2.c \ driver2.spec \ + driver3.c \ + driver3.spec \ ntoskrnl.c diff --git a/dlls/ntoskrnl.exe/tests/driver3.c b/dlls/ntoskrnl.exe/tests/driver3.c new file mode 100644 index 0000000000..a7737a960a --- /dev/null +++ b/dlls/ntoskrnl.exe/tests/driver3.c @@ -0,0 +1,31 @@ +/* + * Copyright 2018 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "winternl.h" +#include "ddk/wdm.h" + +NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *obj, UNICODE_STRING *path) +{ + DbgPrint("driver3: DriverEntry\n"); + + return STATUS_NOT_IMPLEMENTED; +} diff --git a/dlls/ntoskrnl.exe/tests/driver3.spec b/dlls/ntoskrnl.exe/tests/driver3.spec new file mode 100644 index 0000000000..ad33444716 --- /dev/null +++ b/dlls/ntoskrnl.exe/tests/driver3.spec @@ -0,0 +1 @@ +# nothing here yet diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 73f0e85a51..fe070d4e8b 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -219,6 +219,26 @@ static void test_load_driver(SC_HANDLE service) ok(status.dwCurrentState == SERVICE_STOPPED, "got state %#x\n", status.dwCurrentState); }
+static void test_driver3(void) +{ + char filename[MAX_PATH]; + SC_HANDLE service; + BOOL ret; + + service = load_driver(filename, "driver3.dll", "WineTestDriver3"); + ok(service != NULL, "driver3 failed to load\n"); + + ret = StartServiceA(service, 0, NULL); + ok(!ret, "driver3 should fail to start\n"); +todo_wine + ok(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED || GetLastError() == ERROR_PROC_NOT_FOUND /* XP */ || + GetLastError() == ERROR_FILE_NOT_FOUND /* Win7 */, "got %u\n", GetLastError()); + + DeleteService(service); + CloseServiceHandle(service); + DeleteFileA(filename); +} + START_TEST(ntoskrnl) { char filename[MAX_PATH], filename2[MAX_PATH]; @@ -247,4 +267,6 @@ START_TEST(ntoskrnl) unload_driver(service); ok(DeleteFileA(filename), "DeleteFile failed: %u\n", GetLastError()); ok(DeleteFileA(filename2), "DeleteFile failed: %u\n", GetLastError()); + + test_driver3(); }