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
eString@8 referenced in function _DrvEnablePDEV@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

[SOLUTION] Re: Any solution to "error LNK2019: unresolved external by Omer

Omer
Wed May 17 14:33:49 CDT 2006

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

Omer Boyaci wrote:
> 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
> eString@8 referenced in function _DrvEnablePDEV@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

Re: [SOLUTION] Re: Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8" by Doron

Doron
Wed May 17 21:28:45 CDT 2006

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.


"Omer Boyaci" <omerboyaci@hotmail.com.invalid> wrote in message
news:OFiDUjeeGHA.3588@TK2MSFTNGP02.phx.gbl...
> 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
>
> Omer Boyaci wrote:
>> 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
>> eString@8 referenced in function _DrvEnablePDEV@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



[HELP] Re: Any solution to "error LNK2019: unresolved external by Omer

Omer
Wed May 17 22:41:54 CDT 2006

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

>> 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
>> eString@8 referenced in function _DrvEnablePDEV@44

during linking.

Any help is greatly appreciated...

Omer Boyaci


Omer Boyaci wrote:
> 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
>
> Omer Boyaci wrote:
>> 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
>> eString@8 referenced in function _DrvEnablePDEV@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

Re: [HELP] Re: Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8" by David

David
Wed May 17 22:59:05 CDT 2006

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.

"Omer Boyaci" <omerboyaci@hotmail.com.invalid> wrote in message
news:uxj8B0ieGHA.1264@TK2MSFTNGP05.phx.gbl...
>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
>
> >> 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
> >> eString@8 referenced in function _DrvEnablePDEV@44
>
> during linking.
>
> Any help is greatly appreciated...
>
> Omer Boyaci
>
>
> Omer Boyaci wrote:
>> 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
>>
>> Omer Boyaci wrote:
>>> 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
>>> eString@8 referenced in function _DrvEnablePDEV@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



Re: [HELP] Re: Any solution to "error LNK2019: unresolved external by Omer

Omer
Thu May 18 03:27:27 CDT 2006

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.
---------------------------------------------------------------------------



David J. Craig wrote:
> 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.
>
> "Omer Boyaci" <omerboyaci@hotmail.com.invalid> wrote in message
> news:uxj8B0ieGHA.1264@TK2MSFTNGP05.phx.gbl...
>> 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
>>
>>>> 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
>>>> eString@8 referenced in function _DrvEnablePDEV@44
>> during linking.
>>
>> Any help is greatly appreciated...
>>
>> Omer Boyaci
>>
>>
>> Omer Boyaci wrote:
>>> 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
>>>
>>> Omer Boyaci wrote:
>>>> 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
>>>> eString@8 referenced in function _DrvEnablePDEV@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
>
>

Re: Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8" by Maxim

Maxim
Thu May 18 08:54:10 CDT 2006

You cannot use kernel APIs from the graphics driver, you can only use
EngXxx APIs.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Omer Boyaci" <omerboyaci@hotmail.com.invalid> wrote in message
news:%23bEGWndeGHA.2188@TK2MSFTNGP05.phx.gbl...
> 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
> eString@8 referenced in function _DrvEnablePDEV@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


Re: Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8" by Omer

Omer
Thu May 18 09:10:12 CDT 2006

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

Maxim S. Shatskih wrote:
> You cannot use kernel APIs from the graphics driver, you can only use
> EngXxx APIs.
>

Re: [HELP] Re: Any solution to "error LNK2019: unresolved external symbol __imp__RtlInitUnicodeString@8" by David

David
Thu May 18 11:30:27 CDT 2006

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.

"Omer Boyaci" <omerboyaci@hotmail.com> wrote in message
news:urRamTleGHA.4304@TK2MSFTNGP05.phx.gbl...
> 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.
> ---------------------------------------------------------------------------
>
>
>
> David J. Craig wrote:
>> 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.
>>
>> "Omer Boyaci" <omerboyaci@hotmail.com.invalid> wrote in message
>> news:uxj8B0ieGHA.1264@TK2MSFTNGP05.phx.gbl...
>>> 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
>>>
>>>>> 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
>>>>> eString@8 referenced in function _DrvEnablePDEV@44
>>> during linking.
>>>
>>> Any help is greatly appreciated...
>>>
>>> Omer Boyaci
>>>
>>>
>>> Omer Boyaci wrote:
>>>> 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
>>>>
>>>> Omer Boyaci wrote:
>>>>> 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
>>>>> eString@8 referenced in function _DrvEnablePDEV@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
>>