Skip to content

Commit

Permalink
README.md update
Browse files Browse the repository at this point in the history
Signed-off-by: Toni Uhlig <[email protected]>
  • Loading branch information
utoni committed Aug 30, 2022
1 parent 5b01d3f commit 10ab612
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build](https://github.com/utoni/mingw-w64-ddk-template/actions/workflows/build.yml/badge.svg "Github Actions")](https://github.com/utoni/mingw-w64-ddk-template/actions/workflows/build.yml)
[![Gitlab-CI](https://gitlab.com/utoni/mingw-w64-ddk-template/badges/master/pipeline.svg "Gitlab-CI: master branch")](https://gitlab.com/utoni/mingw-w64-ddk-template/-/pipelines)
[![Gitlab-CI](https://gitlab.com/utoni/mingw-w64-ddk-template/badges/main/pipeline.svg "Gitlab-CI: main branch")](https://gitlab.com/utoni/mingw-w64-ddk-template/-/pipelines)
[![Circle-CI](https://circleci.com/gh/utoni/mingw-w64-ddk-template.svg?style=shield "Circle-CI")](https://app.circleci.com/pipelines/github/utoni/mingw-w64-ddk-template)

# Mingw64 Driver Plus Plus
Expand Down Expand Up @@ -84,7 +84,7 @@ Most of the time copy&pasting missing libc/libgcc functions from various online
Remember: The CRT/CRT++ **sets a driver unload function** meaning that code .e.g.:

```C
NTSTATUS MyDriverEntry(_In_ struct _DRIVER_OBJECT * DriverObject, _In_ PUNICODE_STRING RegistryPath)
NTSTATUS DriverEntry(_In_ struct _DRIVER_OBJECT * DriverObject, _In_ PUNICODE_STRING RegistryPath)
{
DriverObject->DriverUnload = MyDriverUnload;
}
Expand All @@ -96,6 +96,21 @@ Make sure that the symbol `DriverUnload` exists and has the usual ddk function s
`void DriverUnload(_In_ struct _DRIVER_OBJECT * DriverObject)`.
This is required to make ctors/dtors work without calling additional functions in `DriverEntry` / `DriverUnload`.
Do not forget to disable `C++ name mangeling` if your driver source is compiled with `g++`:
```C++
extern "C" {
NTSTATUS DriverEntry(_In_ struct _DRIVER_OBJECT *DriverObject, _In_ PUNICODE_STRING RegistryPath)
{
// ...
}
VOID DriverUnload(_In_ struct _DRIVER_OBJECT *DriverObject)
{
// ...
}
}
```

## Host EASTL/CRT/CRT++ Build

It is possible to build parts of the repository for your host distribution.
Expand Down Expand Up @@ -139,6 +154,8 @@ $(USERSPACE_TARGET): $(USERSPACE_OBJECTS)
$(call LINK_CPP_USER_TARGET,$(USERSPACE_OBJECTS),$@)
```

[A simple and stupid project example.](https://github.com/utoni/mingw-w64-driver)

## Thanks goes to:

- [Zeranoe](https://github.com/Zeranoe/mingw-w64-build) for the Mingw64 build script
Expand Down

0 comments on commit 10ab612

Please sign in to comment.