Discussion:
Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8"
(too old to reply)
Omer Boyaci
2006-05-17 17:46:30 UTC
Permalink
Hi,
I have the following code:
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;

RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");

InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------

AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------

Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
***@8 referenced in function ***@44
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done

2 files compiled
1 executable built - 2 Errors
Omer Boyaci
2006-05-17 19:33:49 UTC
Permalink
By searching other examples I found this solutions.

I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib

And it works :)

Sincerely,

Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
Doron Holan [MS]
2006-05-18 02:28:45 UTC
Permalink
you don't want to link against both wdm.lib and ntoskrnl.lib. just pick one
of them.

d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Omer Boyaci
By searching other examples I found this solutions.
I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
And it works :)
Sincerely,
Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
Omer Boyaci
2006-05-18 03:41:54 UTC
Permalink
I figured out that my solution does not work.
After adding these three lines to "sources" It compiled and linked but
when I run the app, Windebug did not capture/print anything from the
driver. I found that this line causes the problem
"RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");".
Also I found that most of the other DDK samples uses
RtlInitUnicodeString but they never add

TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib

lines to the "sources". I tried to build them with build -cZ and no
problem. But my app gives
Post by Omer Boyaci
Post by Omer Boyaci
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
during linking.

Any help is greatly appreciated...

Omer Boyaci
Post by Omer Boyaci
By searching other examples I found this solutions.
I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
And it works :)
Sincerely,
Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
David J. Craig
2006-05-18 03:59:05 UTC
Permalink
Have you checked to see if that routine is available to display drivers?
Many of the 'funny' drivers have absurd restrictions in what they can use.
I know SCSI miniports, ethernet cards, and some other groups are very
specialized.
Post by Omer Boyaci
I figured out that my solution does not work.
After adding these three lines to "sources" It compiled and linked but
when I run the app, Windebug did not capture/print anything from the
driver. I found that this line causes the problem
"RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");".
Also I found that most of the other DDK samples uses RtlInitUnicodeString
but they never add
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
lines to the "sources". I tried to build them with build -cZ and no
problem. But my app gives
Post by Omer Boyaci
Post by Omer Boyaci
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
during linking.
Any help is greatly appreciated...
Omer Boyaci
Post by Omer Boyaci
By searching other examples I found this solutions.
I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
And it works :)
Sincerely,
Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
Omer Boyaci
2006-05-18 08:27:27 UTC
Permalink
Hi,

MSDN Library gives the following explaination. I believe all the other
run-time library routines are available except the listed ones.

Thanks,

Omer

---------------------------------------------------------------------------
Run-Time Library Routines
This section describes the run-time library routines, in alphabetical
order.

For an overview of the functionality of these routines, see Summary of
Kernel-Mode Support Routines.

The following routines are reserved for system use. Do not use them in
your driver.

RtlAssert. Use ASSERT instead.

RtlGetCallersAddress

RtlInterlockedAndBits. Use InterlockedAnd instead.

RtlInterlockedAndBitsDiscardReturn. Use InterlockedAnd instead.

RtlInterlockedClearBits. Use InterlockedAnd instead.

RtlInterlockedClearBitsDiscardReturn. Use InterlockedAnd instead.

RtlInterlockedSetBits. Use InterlockedOr instead.

RtlInterlockedSetBitsDiscardReturn. Use InterlockedOr instead.

RtlInterlockedSetClearBits

RtlInterlockedXorBits. Use InterlockedXor instead.
---------------------------------------------------------------------------
Post by David J. Craig
Have you checked to see if that routine is available to display drivers?
Many of the 'funny' drivers have absurd restrictions in what they can use.
I know SCSI miniports, ethernet cards, and some other groups are very
specialized.
Post by Omer Boyaci
I figured out that my solution does not work.
After adding these three lines to "sources" It compiled and linked but
when I run the app, Windebug did not capture/print anything from the
driver. I found that this line causes the problem
"RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");".
Also I found that most of the other DDK samples uses RtlInitUnicodeString
but they never add
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
lines to the "sources". I tried to build them with build -cZ and no
problem. But my app gives
Post by Omer Boyaci
Post by Omer Boyaci
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
during linking.
Any help is greatly appreciated...
Omer Boyaci
Post by Omer Boyaci
By searching other examples I found this solutions.
I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
And it works :)
Sincerely,
Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
David J. Craig
2006-05-18 16:30:27 UTC
Permalink
I am referring to routines not permitted drivers in the display class. You
need to be looking at the DDK docs for display drivers. Also look at the
WHQL tests for your driver to see if some routines are prohibited.
Post by Omer Boyaci
Hi,
MSDN Library gives the following explaination. I believe all the other
run-time library routines are available except the listed ones.
Thanks,
Omer
---------------------------------------------------------------------------
Run-Time Library Routines
This section describes the run-time library routines, in alphabetical
order.
For an overview of the functionality of these routines, see Summary of
Kernel-Mode Support Routines.
The following routines are reserved for system use. Do not use them in
your driver.
RtlAssert. Use ASSERT instead.
RtlGetCallersAddress
RtlInterlockedAndBits. Use InterlockedAnd instead.
RtlInterlockedAndBitsDiscardReturn. Use InterlockedAnd instead.
RtlInterlockedClearBits. Use InterlockedAnd instead.
RtlInterlockedClearBitsDiscardReturn. Use InterlockedAnd instead.
RtlInterlockedSetBits. Use InterlockedOr instead.
RtlInterlockedSetBitsDiscardReturn. Use InterlockedOr instead.
RtlInterlockedSetClearBits
RtlInterlockedXorBits. Use InterlockedXor instead.
---------------------------------------------------------------------------
Post by David J. Craig
Have you checked to see if that routine is available to display drivers?
Many of the 'funny' drivers have absurd restrictions in what they can
use. I know SCSI miniports, ethernet cards, and some other groups are
very specialized.
Post by Omer Boyaci
I figured out that my solution does not work.
After adding these three lines to "sources" It compiled and linked but
when I run the app, Windebug did not capture/print anything from the
driver. I found that this line causes the problem
"RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");".
Also I found that most of the other DDK samples uses
RtlInitUnicodeString but they never add
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
lines to the "sources". I tried to build them with build -cZ and no
problem. But my app gives
Post by Omer Boyaci
Post by Omer Boyaci
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory
c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
during linking.
Any help is greatly appreciated...
Omer Boyaci
Post by Omer Boyaci
By searching other examples I found this solutions.
I added these lines to the "sources" file
TARGETLIBS= \
$(DDK_LIB_PATH)\wdm.lib\
$(DDK_LIB_PATH)\ntoskrnl.lib
And it works :)
Sincerely,
Omer
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory
c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
Maxim S. Shatskih
2006-05-18 13:54:10 UTC
Permalink
You cannot use kernel APIs from the graphics driver, you can only use
EngXxx APIs.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
***@storagecraft.com
http://www.storagecraft.com
Post by Omer Boyaci
Hi,
-----------------------------------------------------------------------------
OBJECT_ATTRIBUTES myObjectAttr;
UNICODE_STRING myObjectName;
RtlInitUnicodeString(&myObjectName, L"\\??\\d:\\output.txt");
InitializeObjectAttributes(
&myObjectAttr,
&myObjectName,
OBJ_KERNEL_HANDLE|OBJ_FORCE_ACCESS_CHECK,
NULL,
NULL);
-----------------------------------------------------------------------------
AND getting this error with standart build -Cz. Any help. Thanks beforehand
-----------------------------------------------------------------------------
Linking Executable - disp\objchk_wxp_x86\i386\mirror.dll for i386
errors in directory c:\winddk\3790~1.183\src\video\displays\mirror\disp
disp\enable.obj : error LNK2019: unresolved external symbol
__imp__RtlInitUnicod
disp\objchk_wxp_x86\i386\mirror.dll : error LNK1120: 1 unresolved externals
BUILD: Linking c:\winddk\3790~1.183\src\video\displays\mirror\mini directory
BUILD: Done
2 files compiled
1 executable built - 2 Errors
Omer Boyaci
2006-05-18 14:10:12 UTC
Permalink
Thank you very much.

I actually read the User-Mode and Kernel Mode communication and
they suggest to use Sections&Views. I tried to implement this but I get
stuck in the beginning. I even did not create a UNICODE_STRING via
RtlInitUnicodeString. But according to your answer I can not use this
option for graphic drivers.

Then, what is your suggestion, how can I communicate with the user-mode
apps?

Sincerely,

Omer
Post by Maxim S. Shatskih
You cannot use kernel APIs from the graphics driver, you can only use
EngXxx APIs.
Loading...