Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unit testing of WDK driver utility DLL function

5 views
Skip to first unread message

Manfred Wilner

unread,
Nov 10, 2009, 10:27:39 PM11/10/09
to
I am at a loss rigth now!
I have a utility DLL for a Port monitor compiled with the WDK and want to
write Unit tests for exported functions in VS 2008. When I am linking the LIB
in VS and compile the Unit test DLL with the function in question I am
getting an unresolved external error with the reference to this name
(__imp_?IsGoodBasePortName@CMYUTILS@@QAEHPA_W@Z) and apparently is different
from the name in the library (?IsGoodBasePortName@CMYUTILS@@QAEHPAG@Z).
I assume it has something to do how the DLL was compiled but don't know what
I can do about it.

Hope someone can enlighten me.
Thank you,
--
\Manfred

Burkhardt Braun

unread,
Nov 11, 2009, 7:39:17 AM11/11/09
to

Hello,
there is seemingly a mismatch in the argument list given to the
function.
This might be due to default properties like MBCS or UNICODE in the
environment
in difference to the builded DLL.
I would try to build a first version on the command line like
cl -DonnoWhatyouneed Caller.c -link test.lib

Good luck
Burkhardt Braun


Tim Roberts

unread,
Nov 11, 2009, 11:07:48 PM11/11/09
to
Manfred Wilner <mwi...@noemail.noemail> wrote:

>I am at a loss rigth now!
>I have a utility DLL for a Port monitor compiled with the WDK and want to
>write Unit tests for exported functions in VS 2008. When I am linking the LIB
>in VS and compile the Unit test DLL with the function in question I am
>getting an unresolved external error with the reference to this name
>(__imp_?IsGoodBasePortName@CMYUTILS@@QAEHPA_W@Z)

C:\tmp>c++filt ?IsGoodBasePortName@CMYUTILS@@QAEHPA_W@Z
public: int __thiscall CMYUTILS::IsGoodBasePortName(wchar_t *)

>and apparently is different from the name in the library
>(?IsGoodBasePortName@CMYUTILS@@QAEHPAG@Z). I assume it has something to
>do how the DLL was compiled but don't know what I can do about it.

C:\tmp>c++filt ?IsGoodBasePortName@CMYUTILS@@QAEHPAG@Z
public: int __thiscall CMYUTILS::IsGoodBasePortName(unsigned short *)

It was compiled on a compiler where wchar_t is native instead of being
#defined to unsigned short.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Manfred Wilner

unread,
Nov 12, 2009, 12:30:07 PM11/12/09
to
Thank you Tim this is what I thought is the problem but don't know how to
overcome it.
I am compiling the DLL with the WDK compile (7600.16385.0) and link with VS
2008.
So I assume that besides the apparent compiler differences some definitions
are different here as well.

What do I have to do to get this to work?
Also what program did you use to decode this cryptic name?

Thank you for your help.
--
\Manfred

"Tim Roberts" wrote:

> .
>

Burkhardt Braun

unread,
Nov 13, 2009, 11:22:51 AM11/13/09
to
On 12 Nov., 18:30, Manfred Wilner <mwil...@noemail.noemail> wrote:
> Thank you Tim this is what I thought is the problem but don't know how to
> overcome it.
> I am compiling the DLL with the WDK compile (7600.16385.0) and link with VS
> 2008.
> So I assume that besides the apparent compiler differences some definitions
> are different here as well.
>
> What do I have to do to get this to work?
> Also what program did you use to decode this cryptic name?
He used c++filt

>
> Thank you for your help.

Your're welcome!
Burkhardt Braun
BTW.: The wchar_t issue is not too far away from my posting

0 new messages