IoQueryFileDosDeviceName unresolved

*hi,
i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName* but the
error is
error LNK2019: unresolved external symbol
xxxxx@8referenced in function
_NotifyRoutine@12

how to resolve it???
thank you.


-Dheeraj Patni
Live and let Live

The docs say xp and later, but they could be wrong. At this point I
generally dump all the symbols from the nt image in question using either
dumpbin or windbg.

Mark Roddy

On Sat, Sep 4, 2010 at 3:39 AM, Dheeraj Patni wrote:

> hi,
> i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName
but
> the error is
> error LNK2019: unresolved external symbol xxxxx@8referenced in function _NotifyRoutine@12
>
> how to resolve it???
> thank you.
>
>
> –
> -Dheeraj Patni
> Live and let Live
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars 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

Hmmm… this is definitely in XP so you are committing some other gross
programming error.

Mark Roddy

On Sat, Sep 4, 2010 at 8:23 AM, Mark Roddy wrote:

> The docs say xp and later, but they could be wrong. At this point I
> generally dump all the symbols from the nt image in question using either
> dumpbin or windbg.
>
> Mark Roddy
>
>
>
> On Sat, Sep 4, 2010 at 3:39 AM, Dheeraj Patni wrote:
>
>> hi,
>> i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName
but
>> the error is
>> error LNK2019: unresolved external symbol
>> xxxxx@8 referenced in function
>> _NotifyRoutine@12
>>
>> how to resolve it???
>> thank you.
>>
>>
>> –
>> -Dheeraj Patni
>> Live and let Live
>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
>> other seminars 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,
but i am not able to resolve it.I am using Xp,but winddk cant compile it.

On Sat, Sep 4, 2010 at 5:57 PM, Mark Roddy wrote:

> Hmmm… this is definitely in XP so you are committing some other gross
> programming error.
>
> Mark Roddy
>
>
>
> On Sat, Sep 4, 2010 at 8:23 AM, Mark Roddy wrote:
>
>> The docs say xp and later, but they could be wrong. At this point I
>> generally dump all the symbols from the nt image in question using either
>> dumpbin or windbg.
>>
>> Mark Roddy
>>
>>
>>
>> On Sat, Sep 4, 2010 at 3:39 AM, Dheeraj Patni wrote:
>>
>>> hi,
>>> i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName
but
>>> the error is
>>> error LNK2019: unresolved external symbol
>>> xxxxx@8 referenced in function
>>> _NotifyRoutine@12
>>>
>>> how to resolve it???
>>> thank you.
>>>
>>>
>>> –
>>> -Dheeraj Patni
>>> Live and let Live
>>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
>>> other seminars 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
>>
>>
>>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars 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
>


-Dheeraj Patni
Live and let Live

Then you are not building your driver correctly. I just tested this against
the latest WDK using an XP build and it compiles and links just fine.

Mark Roddy

On Sat, Sep 4, 2010 at 10:01 AM, Dheeraj Patni wrote:

> thanks Mark,
> but i am not able to resolve it.I am using Xp,but winddk cant compile it.
>
>
> On Sat, Sep 4, 2010 at 5:57 PM, Mark Roddy wrote:
>
>> Hmmm… this is definitely in XP so you are committing some other gross
>> programming error.
>>
>> Mark Roddy
>>
>>
>>
>> On Sat, Sep 4, 2010 at 8:23 AM, Mark Roddy wrote:
>>
>>> The docs say xp and later, but they could be wrong. At this point I
>>> generally dump all the symbols from the nt image in question using either
>>> dumpbin or windbg.
>>>
>>> Mark Roddy
>>>
>>>
>>>
>>> On Sat, Sep 4, 2010 at 3:39 AM, Dheeraj Patni wrote:
>>>
>>>> hi,
>>>> i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName
but the error is
>>>> error LNK2019: unresolved external symbol
>>>> xxxxx@8 referenced in function
>>>> _NotifyRoutine@12
>>>>
>>>> how to resolve it???
>>>> thank you.
>>>>
>>>>
>>>> –
>>>> -Dheeraj Patni
>>>> Live and let Live
>>>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
>>>> and other seminars 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
>>>
>>>
>>>
>> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
>> other seminars 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
>>
>
>
>
> –
> -Dheeraj Patni
> Live and let Live
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars 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
>

On Sat, 4 Sep 2010 13:09:23 +0530
Dheeraj Patni wrote:

> hi,
> i have windows Xp Service pack 2 and using IoQueryFileDosDeviceName

> but the error is
> error LNK2019: unresolved external symbol
> xxxxx@8referenced in function
> _NotifyRoutine@12

Have you #include’d ntifs.h or fltkernel.h?


Bruce Cran

Dheeraj Patni wrote:

thanks Mark,
but i am not able to resolve it.I am using Xp,but winddk cant compile it.

You are compiling a kernel-mode module, right? That’s a kernel API, not
a user-mode API.

If you can’t get it to fly, zip up your project and send it to me
privately. I’ll take a look.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

hi,all this is my code…

VOID NotifyRoutine (HANDLE parentId,HANDLE processId,BOOLEAN Create)
{
PROC_INFO p_info;
PEPROCESS pEProcess;
NTSTATUS nts;
HANDLE hProcess;
ULONG ulSize;
PUNICODE_STRING pusImageName = NULL;

p_info.parent = parentId;
p_info.process = processId;
p_info.create = Create;

if(Create) DbgPrint(“Execution detected.PID :%d”,processId);
else DbgPrint(“Termination detected.PID :%d”,processId);

PsLookupProcessByProcessId(processId,&pEProcess);
nts = ObOpenObjectByPointer(pEProcess,

OBJ_KERNEL_HANDLE,
NULL,
0,
NULL,
KernelMode,
&hProcess);
if(nts == STATUS_SUCCESS)ObDereferenceObject (pEProcess);
if (!NT_SUCCESS(nts))return;

nts = ZwQueryInformationProcess (hProcess,
27,
0,0,
&ulSize);

if (nts != STATUS_INFO_LENGTH_MISMATCH)return;

pusImageName = (PUNICODE_STRING)
ExAllocatePoolWithTag(PagedPool,(SIZE_T)ulSize,‘cccc’);
if (!pusImageName){
DbgPrint(“pusImageName is still NULL”);
return;
}

nts = ZwQueryInformationProcess(hProcess,
27,
pusImageName,
ulSize,
&ulSize);

if (!NT_SUCCESS(nts))
{
DbgPrint(“zwQuery is NULL”);
}
else
{
UNICODE_STRING pusDosPath;
UNICODE_STRING ObjectName;
PFILE_OBJECT f_object;
PDEVICE_OBJECT d_object;
WCHAR wchar_DHV1 = L"\Device\LanmanRedirector\10.0.0.5\c" ;

DbgPrint(“Image Name:%ws\n”,pusImageName->Buffer);

RtlInitUnicodeString(&ObjectName, wchar_DHV1);

if(
(nts=IoGetDeviceObjectPointer(&ObjectName,FILE_READ_ATTRIBUTES,&f_object,&d_object))==STATUS_SUCCESS)
{
UNICODE_STRING dName;
POBJECT_NAME_INFORMATION objName;

DbgPrint(“IoGetDeviceObjectPointer Success”);

if((nts=RtlVolumeDeviceToDosName(d_object,&dName))==STATUS_SUCCESS)
{
DbgPrint(“Name:%ws”,dName.Buffer);
}
if(IoQueryFileDosDeviceName(f_object,&objName)==STATUS_SUCCESS)
{
DbgPrint(“Success IoQueryFileDosDeviceName”);
}
}
else
{
DbgPrint(“%x IoGetDeviceObjectPointer UnSuccess”,nts);
}

//ExFreePool(ObjectName.Buffer);
}

ExFreePoolWithTag(pusImageName,‘cccc’);

if(index >=INDEX_MAX)index=0;
if( index < INDEX_MAX ){
memcpy(&p_buffer[index],&p_info,sizeof(PROC_INFO));
index++;
}
}

still i cant solve this problem.linker error is there.

On Sat, Sep 4, 2010 at 11:33 PM, Tim Roberts wrote:

> Dheeraj Patni wrote:
> > thanks Mark,
> > but i am not able to resolve it.I am using Xp,but winddk cant compile it.
>
> You are compiling a kernel-mode module, right? That’s a kernel API, not
> a user-mode API.
>
> If you can’t get it to fly, zip up your project and send it to me
> privately. I’ll take a look.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars 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
>


-Dheeraj Patni
Live and let Live

What WDK are you using?
What build environment are you using?

Mm

On Sep 6, 2010 10:14 AM, “Dheeraj Patni” wrote:
> hi,all this is my code…
>
>> VOID NotifyRoutine (HANDLE parentId,HANDLE processId,BOOLEAN Create)
>> {
>> PROC_INFO p_info;
>> PEPROCESS pEProcess;
>> NTSTATUS nts;
>> HANDLE hProcess;
>> ULONG ulSize;
>> PUNICODE_STRING pusImageName = NULL;
>>
>> p_info.parent = parentId;
>> p_info.process = processId;
>> p_info.create = Create;
>>
>> if(Create) DbgPrint(“Execution detected.PID :%d”,processId);
>> else DbgPrint(“Termination detected.PID :%d”,processId);
>>
>> PsLookupProcessByProcessId(processId,&pEProcess);
>> nts = ObOpenObjectByPointer(pEProcess,
>>
>> OBJ_KERNEL_HANDLE,
>> NULL,
>> 0,
>> NULL,
>> KernelMode,
>> &hProcess);
>> if(nts == STATUS_SUCCESS)ObDereferenceObject (pEProcess);
>> if (!NT_SUCCESS(nts))return;
>>
>>
>> nts = ZwQueryInformationProcess (hProcess,
>> 27,
>> 0,0,
>> &ulSize);
>>
>> if (nts != STATUS_INFO_LENGTH_MISMATCH)return;
>>
>> pusImageName = (PUNICODE_STRING)
>> ExAllocatePoolWithTag(PagedPool,(SIZE_T)ulSize,‘cccc’);
>> if (!pusImageName){
>> DbgPrint(“pusImageName is still NULL”);
>> return;
>> }
>>
>> nts = ZwQueryInformationProcess(hProcess,
>> 27,
>> pusImageName,
>> ulSize,
>> &ulSize);
>>
>> if (!NT_SUCCESS(nts))
>> {
>> DbgPrint(“zwQuery is NULL”);
>> }
>> else
>> {
>> UNICODE_STRING pusDosPath;
>> UNICODE_STRING ObjectName;
>> PFILE_OBJECT f_object;
>> PDEVICE_OBJECT d_object;
>> WCHAR wchar_DHV1 = L"\Device\LanmanRedirector\10.0.0.5\c" ;
>>
>> DbgPrint(“Image Name:%ws\n”,pusImageName->Buffer);
>>
>> RtlInitUnicodeString(&ObjectName, wchar_DHV1);
>>
>> if(
>>
(nts=IoGetDeviceObjectPointer(&ObjectName,FILE_READ_ATTRIBUTES,&f_object,&d_object))==STATUS_SUCCESS)
>> {
>> UNICODE_STRING dName;
>> POBJECT_NAME_INFORMATION objName;
>>
>> DbgPrint(“IoGetDeviceObjectPointer Success”);
>>
>> if((nts=RtlVolumeDeviceToDosName(d_object,&dName))==STATUS_SUCCESS)
>> {
>> DbgPrint(“Name:%ws”,dName.Buffer);
>> }
>> if(IoQueryFileDosDeviceName(f_object,&objName)==STATUS_SUCCESS)
>> {
>> DbgPrint(“Success IoQueryFileDosDeviceName”);
>> }
>> }
>> else
>> {
>> DbgPrint(“%x IoGetDeviceObjectPointer UnSuccess”,nts);
>> }
>>
>> //ExFreePool(ObjectName.Buffer);
>> }
>>
>> ExFreePoolWithTag(pusImageName,‘cccc’);
>>
>> if(index >=INDEX_MAX)index=0;
>> if( index < INDEX_MAX ){
>> memcpy(&p_buffer[index],&p_info,sizeof(PROC_INFO));
>> index++;
>> }
>> }
>>
>
> still i cant solve this problem.linker error is there.
>
> On Sat, Sep 4, 2010 at 11:33 PM, Tim Roberts wrote:
>
>> Dheeraj Patni wrote:
>> > thanks Mark,
>> > but i am not able to resolve it.I am using Xp,but winddk cant compile
it.
>>
>> You are compiling a kernel-mode module, right? That’s a kernel API, not
>> a user-mode API.
>>
>> If you can’t get it to fly, zip up your project and send it to me
>> privately. I’ll take a look.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars 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
>>
>
>
>
> –
> -Dheeraj Patni
> Live and let Live
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars 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

@dheeraj patni,
Are you sure that you are using “Windows XP Build Environment” (or later) in WDK to build your driver?

@xxxxx@rocketmail.com
please sorry for my noobnes…you are right.
I was compiling with visual stdio but when i compiled with "Windows XP
checked Build Enveronment " it successfully compiled.
Will anyone tell how can i change the building enveronment in visual
stdio.currently i am taking the librarys from folder
“WINDDK\3790.1830\lib\w2k\
i386”.
thanks.

On Mon, Sep 6, 2010 at 8:32 PM, wrote:

> @dheeraj patni,
> Are you sure that you are using “Windows XP Build Environment” (or later)
> in WDK to build your driver?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars 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
>


-Dheeraj Patni
Live and let Live

Do not try to use Visual Studio directly, this is a terrible idea that
can lead to subtle bugs. If you want to build in a visual studio
environment use DDKbuild from either OSR or from
http://www.hollistech.com/ (these are slightly different versions each
with good and bad points).

Also you are using an incredibly out of date DDK, get the latest WDK
7600.16385 and use it for your development.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Dheeraj Patni” wrote in message
news:xxxxx@ntdev:

> @xxxxx@rocketmail.com
> please sorry for my noobnes…you are right.
> I was compiling with visual stdio but when i compiled with "Windows XP
> checked Build Enveronment " it successfully compiled.
> Will anyone tell how can i change the building enveronment in visual
> stdio.currently i am taking the librarys from folder
> “WINDDK\3790.1830\lib\w2k<br>> i386”.
> thanks.
>
>
> On Mon, Sep 6, 2010 at 8:32 PM, wrote:
>
> > @dheeraj patni,
> > Are you sure that you are using “Windows XP Build Environment” (or later)
> > in WDK to build your driver?
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars 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
> >
>
>
>
> –
> -Dheeraj Patni
> Live and let Live

Use ddkbuild with an external makefile project. Here is a link:
http://www.hollistech.com/Resources/ddkbuild/ddkbuild.htm
http:
Mark Roddy

On Mon, Sep 6, 2010 at 11:54 AM, Dheeraj Patni wrote:

> @xxxxx@rocketmail.com
> please sorry for my noobnes…you are right.
> I was compiling with visual stdio but when i compiled with "Windows XP
> checked Build Enveronment " it successfully compiled.
> Will anyone tell how can i change the building enveronment in visual
> stdio.currently i am taking the librarys from folder
> “WINDDK\3790.1830\lib\w2k<br>> i386”.
> thanks.
>
>
> On Mon, Sep 6, 2010 at 8:32 PM, wrote:
>
>> @dheeraj patni,
>> Are you sure that you are using “Windows XP Build Environment” (or later)
>> in WDK to build your driver?
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars 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
>>
>
>
>
> –
> -Dheeraj Patni
> Live and let Live
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars 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</http:>

http://ddkwizard.assarbad.net/

>Will anyone tell how can i change the building enveronment in visual stdio.

Building drivers in VS is not supported.

The only way is to invoke BUILD as a custom build step in VS - see DDKBUILD.BAT


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

> http://ddkwizard.assarbad.net/

Are you really sure this is bug free?

If somebody will have issues with this masterpiece - then probably no one will help, and switching to BUILD will be the only way.


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

Dheeraj Patni wrote:

please sorry for my noobnes…you are right.
I was compiling with visual stdio but when i compiled with "Windows XP
checked Build Enveronment " it successfully compiled.
Will anyone tell how can i change the building enveronment in visual
stdio.currently i am taking the librarys from folder
“WINDDK\3790.1830\lib\w2k\i386”.

As the documentation says, IoQueryFileDosDeviceName was first introduced
in XP. Therefore, one would be surprised to find it in the Windows 2000
libraries, which is the path you are trying to use.

The right answer is to use the DDK’s build environment to build your
driver. The immediate hacky workaround is to use the “wxp” libraries,
not the “w2k” libraries.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

thanks Tim it works…

On Tue, Sep 7, 2010 at 10:28 PM, Tim Roberts wrote:
>
>> Dheeraj Patni wrote:
>> >
>> > please sorry for my noobnes…you are right.
>> > I was compiling with visual stdio but when i compiled with "Windows XP
>> > checked Build Enveronment " it successfully compiled.
>> > Will anyone tell how can i change the building enveronment in visual
>> > stdio.currently i am taking the librarys from folder
>> > “WINDDK\3790.1830\lib\w2k\i386”.
>>
>> As the documentation says, IoQueryFileDosDeviceName was first introduced
>> in XP. Therefore, one would be surprised to find it in the Windows 2000
>> libraries, which is the path you are trying to use.
>>
>> The right answer is to use the DDK’s build environment to build your
>> driver. The immediate hacky workaround is to use the “wxp” libraries,
>> not the “w2k” libraries.
>>
>> –
>> Tim Roberts, xxxxx@probo.com
>> Providenza & Boekelheide, Inc.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars 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
>>
>
>
>
> –
> -Dheeraj Patni
> Live and let Live
>


-Dheeraj Patni
Live and let Live