Building a dll using WinDDK

Hi,
I got the minispy filter driver running on my system with lots of help from this forum :slight_smile:

I have another problem now:
I want to export the InterpretCommand function of the mspyUser.c file to a dll called mspyUser.dll, so I can call it from a GUI that I am making in C#.

I tried using __declspec(dllexport), but got an error saying:
NMAKE : fatal error U1073: don’t know how to make ‘minispy.def’

So I made a minispy.def file containing this:
NAME MINISPY.DLL

EXPORTS
InterpretCommand

Now the files compile but don’t get linked. I get this error:

Building Library - user\user\objfre_win7_amd64\amd64\minispy.lib
1>errors in directory c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>link : error LNK1218: warning treated as error; no output file generated
BUILD: Compiling and Linking c:\winddk\7600.16385.0\src\filesys\minifilter\minis
py\filter directory
BUILD: Compile errors: not linking c:\winddk\7600.16385.0\src\filesys\minifilter
\minispy\user directory
BUILD: Finish time: Sat Jan 09 23:52:57 2010
BUILD: Done

1 library built - 1 Warning - 1 Error

One more thing I noticed was that it is building a .lib, not a .dll .

Here’s my sources file:
TARGETNAME=minispy
TARGETTYPE=DYNLINK
UMTYPE=console
USE_MSVCRT=1
DLLDEF=minispy.def

C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE

LINKLIBS=$(SDK_LIB_PATH)\shell32.lib

INCLUDES=$(INCLUDES); \
$(IFSKIT_INC_PATH); \
$(DDK_INC_PATH); \
…\inc

TARGETLIBS=$(TARGETLIBS) \
$(IFSKIT_LIB_PATH)\fltLib.lib

SOURCES=mspyLog.c \
mspyUser.c \
mspyUser.rc

!if “$(DDK_TARGET_OS)”==“WinLH”
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
!endif

Can someone help me out with this?

Thank you all so much!

saurako

I am pretty sure that there are examples of building DLLS in the WDK. At OSR we do it all the time. If you don’t see one in the DDK, then there is a Nothing example with a property page somewhere on OSR ONLINE that has an example…

–Mark Cariddi
OSR, Open Systems Resources, inc…

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Sunday, January 10, 2010 1:02 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Building a dll using WinDDK

Hi,
I got the minispy filter driver running on my system with lots of help from this forum :slight_smile:

I have another problem now:
I want to export the InterpretCommand function of the mspyUser.c file to a dll called mspyUser.dll, so I can call it from a GUI that I am making in C#.

I tried using __declspec(dllexport), but got an error saying:
NMAKE : fatal error U1073: don’t know how to make ‘minispy.def’

So I made a minispy.def file containing this:
NAME MINISPY.DLL

EXPORTS
InterpretCommand

Now the files compile but don’t get linked. I get this error:

Building Library - user\user\objfre_win7_amd64\amd64\minispy.lib
1>errors in directory c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>link : error LNK1218: warning treated as error; no output file generated
BUILD: Compiling and Linking c:\winddk\7600.16385.0\src\filesys\minifilter\minis
py\filter directory
BUILD: Compile errors: not linking c:\winddk\7600.16385.0\src\filesys\minifilter
\minispy\user directory
BUILD: Finish time: Sat Jan 09 23:52:57 2010
BUILD: Done

1 library built - 1 Warning - 1 Error

One more thing I noticed was that it is building a .lib, not a .dll .

Here’s my sources file:
TARGETNAME=minispy
TARGETTYPE=DYNLINK
UMTYPE=console
USE_MSVCRT=1
DLLDEF=minispy.def

C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE

LINKLIBS=$(SDK_LIB_PATH)\shell32.lib

INCLUDES=$(INCLUDES); \
$(IFSKIT_INC_PATH); \
$(DDK_INC_PATH); \
…\inc

TARGETLIBS=$(TARGETLIBS) \
$(IFSKIT_LIB_PATH)\fltLib.lib

SOURCES=mspyLog.c \
mspyUser.c \
mspyUser.rc

!if “$(DDK_TARGET_OS)”==“WinLH”
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
!endif

Can someone help me out with this?

Thank you all so much!

saurako


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Mark.

-saurako

On Sun, Jan 10, 2010 at 10:42 AM, Mark Cariddi wrote:

> I am pretty sure that there are examples of building DLLS in the WDK. At
> OSR we do it all the time. If you don’t see one in the DDK, then there is
> a Nothing example with a property page somewhere on OSR ONLINE that has an
> example…
>
> --Mark Cariddi
> OSR, Open Systems Resources, inc…
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
> Sent: Sunday, January 10, 2010 1:02 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] Building a dll using WinDDK
>
> Hi,
> I got the minispy filter driver running on my system with lots of help from
> this forum :slight_smile:
>
> I have another problem now:
> I want to export the InterpretCommand function of the mspyUser.c file to a
> dll called mspyUser.dll, so I can call it from a GUI that I am making in C#.
>
> I tried using __declspec(dllexport), but got an error saying:
> NMAKE : fatal error U1073: don’t know how to make ‘minispy.def’
>
> So I made a minispy.def file containing this:
> NAME MINISPY.DLL
>
> EXPORTS
> InterpretCommand
>
> Now the files compile but don’t get linked. I get this error:
>
> Building Library - user\user\objfre_win7_amd64\amd64\minispy.lib
> 1>errors in directory
> c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
> 1>link : error LNK1218: warning treated as error; no output file generated
> BUILD: Compiling and Linking
> c:\winddk\7600.16385.0\src\filesys\minifilter\minis
> py\filter directory
> BUILD: Compile errors: not linking
> c:\winddk\7600.16385.0\src\filesys\minifilter
> \minispy\user directory
> BUILD: Finish time: Sat Jan 09 23:52:57 2010
> BUILD: Done
>
> 1 library built - 1 Warning - 1 Error
>
>
> One more thing I noticed was that it is building a .lib, not a .dll .
>
> Here’s my sources file:
> TARGETNAME=minispy
> TARGETTYPE=DYNLINK
> UMTYPE=console
> USE_MSVCRT=1
> DLLDEF=minispy.def
>
> C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
>
> LINKLIBS=$(SDK_LIB_PATH)\shell32.lib
>
> INCLUDES=$(INCLUDES); <br>> $(IFSKIT_INC_PATH); <br>> $(DDK_INC_PATH); <br>> …\inc
>
> TARGETLIBS=$(TARGETLIBS) <br>> $(IFSKIT_LIB_PATH)\fltLib.lib
>
> SOURCES=mspyLog.c <br>> mspyUser.c <br>> mspyUser.rc
>
> !if “$(DDK_TARGET_OS)”==“WinLH”
> _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
> !endif
>
>
>
> Can someone help me out with this?
>
> Thank you all so much!
>
> saurako
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

> I tried using __declspec(dllexport),

Bad idea, this results in a mangled name in the DLL exports.

NAME MINISPY.DLL

EXPORTS
InterpretCommand

Good idea.

1>link : error LNK1218: warning treated as error; no output file generated

And what is the warning? look at the .log file.

SOURCES file looks good. The DLLDEF statement is optional, the default is projectname.DEF

–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

I removed __declspec(dllexport) .

And then changed my sources file a little to this:

TARGETNAME=minispy
TARGETTYPE=DYNLINK
TARGETEXT=DLL

DLLENTRY=DllMain
DLLDEF=minispy.def

INCLUDES=$(INCLUDES); \
$(IFSKIT_INC_PATH); \
$(DDK_INC_PATH); \
…\inc

TARGETLIBS=$(TARGETLIBS) \
$(IFSKIT_LIB_PATH)\fltLib.lib \

SOURCES=mspyLog.c \
mspyUser.c \
mspyUser.rc

USE_MSVCRT=1
USE_CTRLDLL=1

!if “$(DDK_TARGET_OS)”==“WinLH”
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
!endif

I get this error:
1>errors in directory
c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: error C2220: warning treated as error - no ‘object’ file generated
1>link : error LNK1181: cannot open input file
‘c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\mspyuser.obj’

The object file isnt getting generated. There’s another file mspyLog.c in
the directory and the mspyLog.obj gets generated properly. Am I missing some
rule in the sources file?

-saurako

On Sun, Jan 10, 2010 at 11:51 AM, Maxim S. Shatskih
wrote:

> > I tried using __declspec(dllexport),
>
> Bad idea, this results in a mangled name in the DLL exports.
>
> > NAME MINISPY.DLL
> >
> > EXPORTS
> > InterpretCommand
>
> Good idea.
>
> > 1>link : error LNK1218: warning treated as error; no output file
> generated
>
> And what is the warning? look at the .log file.
>
> SOURCES file looks good. The DLLDEF statement is optional, the default is
> projectname.DEF
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

What was your BUILD command line?

mm

I just say build at the command line.
I’m using the x64 build environment.

On Sun, Jan 10, 2010 at 5:16 PM, wrote:

> What was your BUILD command line?
>
>
> mm
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Try ‘build -ceZ.’

mm

I get the same error with build -ceZ

-saurako

On Sun, Jan 10, 2010 at 5:27 PM, wrote:

> Try ‘build -ceZ.’
>
>
> mm
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Does the ‘.res’ file get generated?

mm

Nope… only the .mac file and mspyLog.obj file get generated.

On Sun, Jan 10, 2010 at 5:33 PM, wrote:

> Does the ‘.res’ file get generated?
>
>
> mm
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

  1. Are there are characters following the '' in:

SOURCES=mspyLog.c \

  1. What’s line 114:

1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)

  1. Have you tried just deleting the whole build directory (i. e. - objfre_win7_amd64)?

mm

I put this into one line and tried:

SOURCES=mspyLog.c mspyUser.c mspyUser.rc

And yes, I’ve been deleting the objfre_win7_amd64 directory.

Line 114 is this:

110 count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
111 NULL,
112 Code,
113 0,
114 buffer,
115 sizeof(buffer) / sizeof(WCHAR),
116 NULL);

-saurako

On Sun, Jan 10, 2010 at 5:46 PM, wrote:

> 1. Are there are characters following the '' in:
>
> SOURCES=mspyLog.c <br>>
> 2. What’s line 114:
>
>
> 1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
>
> 3. Have you tried just deleting the whole build directory (i. e. -
> objfre_win7_amd64)?
>
>
> mm
>
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Is their a warnings file (*.wrn)?

mm

Yes… this is what it contains:
1>warnings in directory
c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: warning C4133: ‘function’ : incompatible types - from ‘WCHAR [260]’ to
‘LPSTR’

Is my sources file correct? Am I missing some rule?

-saurako

On Sun, Jan 10, 2010 at 6:07 PM, wrote:

> Is their a warnings file (*.wrn)?
>
>
> mm
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Yes you’re missing something - it’s not compiling due to a warning.

1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114) : warning C4133: ‘function’ : incompatible types - from ‘WCHAR [260]’ to ‘LPSTR’

Judging from what your reported as line 114 -

110 count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
111 NULL,
112 Code,
113 0,
114 buffer,
115 sizeof(buffer) / sizeof(WCHAR),
116 NULL);

I’d guess that you are trying to compile it as ANSI (not UNICODE), or that you have redefined something incorrectly, as that FormatMessage() instance above is not the same as the original one in the wdk.

How about you post the .log file?

mm

I havent changed the FormatMessage() function. I’ve only made changes in the
sources file. And added these lines in the mspyUser.c file:

//dllEntry point
BOOL WINAPI
DllMain(
HINSTANCE hModule,
DWORD Reason,
LPVOID pReserved )
{
UNREFERENCED_PARAMETER(pReserved);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);
// LogDebug(DBG_PROCESS_ATTACH, (LPWSTR)(“DllInitialize:
DLL_PROCESS_ATTACH”));
break;
case DLL_PROCESS_DETACH:
// LogDebug(DBG_PROCESS_DETACH,
// (LPWSTR)(“DllInitialize:
// LL_PROCESS_DETACH Destroy CACHED data”));
break;
}
return (TRUE);
}

Here’s the .log file:

BUILD: Computing Include file dependencies:
BUILD: Examining c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
directory for files to compile.
oacr invalidate wdksamples:amd64fre /autocleanqueue
1>Compiling c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
*************
1>‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS1 NOLINK=1 NOPASS0=1
MAKEDIR_RELATIVE_TO_BASEDIR=src\filesys\minifilter\minispy\user’
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user: TARGETPATH is
OBJ
1> C:\WinDDK\7600.16385.0\Bin\amd64\oacr\oacrcl
@c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\cl.rsp
1>Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.207 for x64
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>cl
/Fo"c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64/"
1> /FC
1> /Iamd64\
1> /I.
1> /IC:\WinDDK\7600.16385.0\inc\ddk
1> /IC:\WinDDK\7600.16385.0\inc\ddk
1> /I…\inc
1>
/Ic:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64
1> /Ic:\winddk\7600.16385.0\WDKSamples\inc
1> /Ic:\winddk\7600.16385.0\WDKSamples\inc\objfre_win7_amd64\amd64
1> /Ic:\winddk\7600.16385.0\internal\WDKSamples\inc
1> /IC:\WinDDK\7600.16385.0\inc\api
1> /IC:\WinDDK\7600.16385.0\inc\api
1> /IC:\WinDDK\7600.16385.0\inc\crt
1> /D_WIN64
1> /D_AMD64_
1> /DAMD64
1> /DCONDITION_HANDLING=1
1> /DNT_UP=1
1> /DNT_INST=0
1> /DWIN32=100
1> /D_NT1X_=100
1> /DWINNT=1
1> /D_WIN32_WINNT=0x0601
1> /DWINVER=0x0601
1> /D_WIN32_IE=0x0800
1> /DWIN32_LEAN_AND_MEAN=1
1> /DDEVL=1
1> /D__BUILDMACHINE__=WinDDK
1> /DNDEBUG
1> /D_DLL=1
1> /D_MT=1
1> /DNTDDI_VERSION=0x06010000
1> /c
1> /Zc:wchar_t-
1> /Zl
1> /Zp8
1> /Gy
1> /W3
1> /WX
1> /EHs-c-
1> /GR-
1> /GF
1> /GS
1> /Zi
1> /Oxs
1> /GL
1> /Zi
1>
/Fdc:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\
1> /DKMDF_MAJOR_VERSION_STRING=01
1> /DKMDF_MINOR_VERSION_STRING=009
1> /typedil-
1> /wd4603
1> /wd4627
1> /FIC:\WinDDK\7600.16385.0\inc\api\warning.h
1> .\mspyuser.c
1>mspyuser.c
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: error C2220: warning treated as error - no ‘object’ file generated
1>errors in directory
c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: error C2220: warning treated as error - no ‘object’ file generated
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: warning C4133: ‘function’ : incompatible types - from ‘WCHAR [260]’ to
‘LPSTR’
1>warnings in directory
c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
: warning C4133: ‘function’ : incompatible types - from ‘WCHAR [260]’ to
‘LPSTR’
1> C:\WinDDK\7600.16385.0\Bin\amd64\oacr\oacrlink /lib
/out:c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\minispy.lib
@c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\lib.rsp
1>Microsoft (R) Library Manager Version 9.00.30729.207
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
1>/WX
1>/nodefaultlib
1>/machine:amd64
1>/ltcg
1>/def:minispy.def
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\mspylog.obj
1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\mspyuser.obj
1>LINK : fatal error LNK1181: cannot open input file
‘c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\mspyuser.obj’
1>link : error LNK1181: cannot open input file
‘c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\objfre_win7_amd64\amd64\mspyuser.obj’
Compile errors: not linking
c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user directory
*************

-saurako

On Sun, Jan 10, 2010 at 6:16 PM, wrote:

> Yes you’re missing something - it’s not compiling due to a warning.
>
> 1>c:\winddk\7600.16385.0\src\filesys\minifilter\minispy\user\mspyuser.c(114)
> : warning C4133: ‘function’ : incompatible types - from ‘WCHAR [260]’ to
> ‘LPSTR’
>
> Judging from what your reported as line 114 -
>
> 110 count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
> 111 NULL,
> 112 Code,
> 113 0,
> 114 buffer,
> 115 sizeof(buffer) / sizeof(WCHAR),
> 116 NULL);
>
> I’d guess that you are trying to compile it as ANSI (not UNICODE), or that
> you have redefined something incorrectly, as that FormatMessage() instance
> above is not the same as the original one in the wdk.
>
> How about you post the .log file?
>
>
> mm
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Unless I’m missing something, I think that you did change the call to FormatMessage():

Original:
count = FormatMessage (FORMAT_MESSAGE_FROM_HMODULE,
module,
Code,
0,
buffer,
sizeof(buffer) / sizeof(WCHAR),
NULL);

Yours:
110 count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
111 NULL,
112 Code,
113 0,
114 buffer,
115 sizeof(buffer) / sizeof(WCHAR),
116 NULL);

The line numbers are off I assume because of the addition of DllMain(), but I assume that I’m looking at the right call to FormatMessage() in the original.

It’s hard to say what’s going on without seeing the whole thing, but you might try adding ‘-DUNICODE=1 -D_UNICODE=1’ to your SOURCES file:

USER_C_FLAGS=$(USER_C_FLAGS) -DUNICODE=1 -D_UNICODE=1

Good luck,

mm

Whoops - my bad. I just noticed the other call to FormatMessage() above it.

mm