virtual file system in network UNC don't all work

Hi,
I minimized my export code.

I want manage a virtual file system in network UNC \teste.

I do not know what it says on MSDN, but its not working at all!.

DeviceType = FILE_DEVICE_NETWORK_FILE_SYSTEM;
DWORD charact=FILE_DEVICE_IS_MOUNTED;
if (devicetype==FILE_DEVICE_NETWORK_FILE_SYSTEM)
charact|=FILE_REMOTE_DEVICE;
status=IoCreateDevice(DriverObject,
sizeof (TPARAMVDF),
&dn,
devicetype,
charact,
FALSE,
&gvd);




//Dcb->_namedriver is equal to dn variable
RtlInitUnicodeString(&cs,Dcb->_namedriver);
KdPrintfd2((“Register NetWork driver (%ws)\n”,cs.Buffer));
status = FsRtlRegisterUncProvider(&(Dcb->MupHandle), &cs, FALSE);


In the thread of the driver what receives the function IOCTL_REDIR_QUERY_PATH i allocate mdl, and return STATUS_PENDING and my thread which manage virtual disk file system take the irp returned STATUS_PENDING and
finish by IoCompleteRequest

Thread DrvDispatch driver what receives the function IOCTL_REDIR_QUERY_PATH

NTSTATUS
AllocateMdl(
__in PIRP Irp,
__in ULONG Length
)
{
if (Irp->MdlAddress == NULL) {
PMDL mdl = IoAllocateMdl(Irp->UserBuffer, Length, FALSE, FALSE, Irp);

if (mdl == NULL) {
KdPrintf((" IoAllocateMdl returned NULL\n"));
return STATUS_INSUFFICIENT_RESOURCES;
}
__try {
MmProbeAndLockPages(Irp->MdlAddress, Irp->RequestorMode, IoWriteAccess);

} __except (EXCEPTION_EXECUTE_HANDLER) {
KdPrintf((" MmProveAndLockPages error\n"));
IoFreeMdl(Irp->MdlAddress);
Irp->MdlAddress = NULL;
return STATUS_INSUFFICIENT_RESOURCES;
}
}
return STATUS_SUCCESS;
}

NTSTATUS
DrvDispatch (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PIO_STACK_LOCATION irps;
NTSTATUS status=STATUS_NOT_IMPLEMENTED;
KdPrintf((“[VFUM] control\n”));
irps = IoGetCurrentIrpStackLocation(Irp);



if ((irps->MajorFunction==IRP_MJ_DEVICE_CONTROL))
{
ULONG Length;
PMDL mdl;
if (irps->Parameters.DeviceIoControl.IoControlCode==IOCTL_REDIR_QUERY_PATH)
{
Length = irps->Parameters.Read.Length;

KdPrintfd2((“Int IRP_MJ_DEVICE_CONTROL Offset %x Length %x\n”,irps->Parameters.Read.ByteOffset.LowPart,Length));

if (Irp->MdlAddress==NULL)
{
KdPrintfd2((“Int IRP_MJ_DEVICE_CONTROL Irp->MdlAddress==NULL\n”));
status=AllocateMdl(Irp,sizeof (QUERY_PATH_RESPONSE));
if (!NT_SUCCESS(status))
goto trierrorop;
}
}

}



//PushListHead //push irp in the list head
//IoMarkIrpPending
return STATUS_PENDING;
}

My Thread kernel what manages the virtual disk file system receives the IOCTL function IOCTL_REDIR_QUERY_PATH from IRP taked, it returns STATUS_SUCCESS if it is the string \teste



case IRP_MJ_DEVICE_CONTROL:
KdPrintfd2((“IRP_MJ_DEVICE_CONTROL irp:%x irps:%x\n”,irp,irps));
status=FatDiskControl(hProcess,DeviceObject,irp,irps);
//status= STATUS_NOT_IMPLEMENTED;
break;


IoCompleteRequest

NTSTATUS FatDiskControl(HANDLE hProcess,PDEVICE_OBJECT DeviceObject,PIRP irp,PIO_STACK_LOCATION irps)
{


switch (irps->Parameters.DeviceIoControl.IoControlCode)
{
case IOCTL_REDIR_QUERY_PATH:
{
PQUERY_PATH_REQUEST p;
KdPrintfd2((“query_path_network\n”));

{
int len;
WCHAR *path;
p=irps->Parameters.DeviceIoControl.Type3InputBuffer;
KdPrintfd2((“Path (%ws)\n”,p->FilePathName));
len=wcslen(p->FilePathName)<<1;
path=p->FilePathName;

status=ischaintest(path);
//compare path if \teste

return status;
}

}
break;


}

PVOID
FatMapUserBuffer (
IN OUT PIRP Irp
)

{

PAGED_CODE();

//
// If there is no Mdl, then we must be in the Fsd, and we can simply
// return the UserBuffer field from the Irp.
//

if (Irp->MdlAddress == NULL) {

return Irp->UserBuffer;

} else {

PVOID Address = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority );

if (Address == NULL) {

ExRaiseStatus( STATUS_INSUFFICIENT_RESOURCES );
}

return Address;
}
}

So far it works.

Problem:

The MUP controller instead of the list myself of my virtual file, it will try to open the file \teste\pipe\wkssvc with function IRP_MJ_CREATE
and read with the function IRP_MJ_READ! the SMB controller.

The MUP controller don’t call the function (it does not call any of the function): IRP_MJ_DIRECTORY_CONTROL -> IRP_MN_QUERY_DIRECTORY.

Conclusion: obviously the browser (explorer.exe) returns an error can not access it.

Also :
I also had a random blue screen on the controller MUP :
BugCheck 50, {e2242000, 0, 804db20d, 1}

MODULE_NAME: Mup

FAULTING_MODULE: 804d7000 nt

DEBUG_FLR_IMAGE_TIMESTAMP: 41107ef8

READ_ADDRESS: unable to get nt!MmSpecialPoolStart
unable to get nt!MmSpecialPoolEnd
unable to get nt!MmPoolCodeStart
unable to get nt!MmPoolCodeEnd
e2242000

FAULTING_IP:
nt!memmove+33
804db20d f3a5 rep movs dword ptr es:[edi],dword ptr [esi]

MM_INTERNAL_CODE: 1

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0x50

LAST_CONTROL_TRANSFER: from 805296be to 80537832

STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
b203883c 805296be 00000050 e2242000 00000000 nt!KeBugCheckEx+0x1b
b203888c 804e0f07 00000000 e2242000 00000000 nt!KePulseEvent+0xd123
b20388c4 80552146 81e34c10 00000080 b2030000 nt!Kei386EoiHelper+0x274d
b2038920 f82b3fcc e24e0de8 e2241f90 00000080 nt!ExAllocatePoolWithTag+0x141
b2038940 f82b468d b2038cc0 00000080 e10c5af0 Mup+0x5fcc
b2038974 f82b4471 81bb7e80 b2038cc0 00000000 Mup+0x668d
b20389b8 f82b3b19 81bb7e80 b2038cc0 b2038a50 Mup+0x6471
b2038a14 804e19ee 81eaad70 81bb7e80 81bb7e80 Mup+0x5b19
b2038b04 8056e063 81eaad70 00000000 81dc0008 nt!IofCallDriver+0x32
b2038b7c 805715e8 00000000 b2038bbc 00000040 nt!SeDeleteAccessState+0x573
b2038bd0 8057c0cd 00000000 00000000 e1a9c901 nt!ObOpenObjectByName+0xda
b2038d54 804ddf0f 0006a258 0006a230 0006a284 nt!NtSetInformationProcess+0x304
b2038e0c 80570593 b2038a78 000005c9 00000000 nt!KiDeliverApc+0xbbb
b2038e50 804da591 00000000 00000000 00000001 nt!KeUserModeCallback+0x87
b2038ed0 bf9077d5 bf9076be 00050007 00000038 nt!ExAcquireResourceExclusiveLite+0x4a
b2038ed4 bf9076be 00050007 00000038 e0090001 win32k!EngAlphaBlend+0x42d0
b2038ed8 00050007 00000038 e0090001 746a08b6 win32k!EngAlphaBlend+0x41b9
b2038edc 00000000 e0090001 746a08b6 77d26df4 0x50007

Is necessary i call the function IoFreeMdl after the end of the function IOCTL_REDIR_QUERY_PATH ? I do not know.

I did what was said in MSDN for see my virtual files of my UNC path \teste, and it’s don’t all work !.

What should I do?

Thank you.

i try \teste\ty.txt.
The file is good opened by notepad.exe and i view containing on my file ty.txt
but when i try \teste , it’s don’t work, i don’t see some my virtual files.

i try \teste\mydirectory , don’t work
i try \teste\mydirectory\ , work
i try \teste\ don’t work

I am not sure if it is good idea to take volume based filesystem and try to change it into remote FSD.

Just several notes regarding your code:
Seeing wcslen(). You are in driver land, strings are not null char terminated. Do you think that QUERY_PATH_REQUEST.PathNameLength is here just for fun?
Also format parameter “%ws” might cause BSOD. I would assing it into UNICODE_STRING and print it with %wZ.

Next time try to setup system symbols, so stack shows more correct info.

Regards,
Bronislav Gabrhelik

On 10/6/2010 7:30 AM, xxxxx@xythos.com wrote:

I am not sure if it is good idea to take volume based filesystem and try to change it into remote FSD.

It really depends on how you implement the file system. It is possible
to leverage the internal operations from a volume based fs within a
redirector but in general, they are different enough that the work
required to make this mapping is equivalent to just doing it right the
first time.

Just several notes regarding your code:
Seeing wcslen(). You are in driver land, strings are not null char terminated. Do you think that QUERY_PATH_REQUEST.PathNameLength is here just for fun?
Also format parameter “%ws” might cause BSOD. I would assing it into UNICODE_STRING and print it with %wZ.

For fun? I would think not. They are passing in this length so you know
what portion you are to process as well you return this length
indicating how much of the path you are going to process. As for the
name strings, if you initialize the UNICODE_STRING correctly it will
work. If it is crashing there is something you are doing incorrectly.

As a side note, the two issues you mention above are a minor component
of the overall infrastructure of a file system. You do realize this, no?

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

How to change it into remote FSD ???

Pardon MSDN Say than DeviceCharacteristics should be FILE_REMOTE_DEVICE

On 10/7/2010 2:21 PM, xxxxx@sivaller.no-ip.org wrote:

How to change it into remote FSD ???

You are trying to change a virtual FSD to a remote FSD? It’s not as
simple as just switching a few flags. There is an entire infrastructure
which must be implemented to handle registration with MUP.

Pete


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


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

I use a process that manages a virtual disk files through the intermediary of a kernel driver,
and at the same time it controls the querypath.

On the software Total Commander, I should have two valid times \teste\aa\
for viewing my files.

In explorer it does not work at all!

I do not know what to do, I turn on Windows Seven.

In user-process

Thread controller :

WCHAR reseau=L"\TESTE";

DWORD WINAPI cdisk(VOID* param)
{
hDrvThread=CreateFile(VDUM_CTL_DOSDEV_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

DWORD cb=0;
SetLastError(0);



if control(hDrvThread,IOCTL_CMD_RETREIVECOMMAND,&command,sizeof TCOMMAND,&command,sizeof TCOMMAND,iscom))
{


if (command.commande==CMD_QUERYINFORMATION)
{
ok=true;
fprintf(fout,“Query information\n”);
procinfo(&command);
}
if (command.commande==CMD_QUERYPATH)
{
ok=true;
fprintf(fout,“QueryPath\n”);
procquerypath(&command);
}



//signal for command terminated
if (!control(hDrvThread,IOCTL_CMD_ENDCOMMAND,&command.id,sizeof USHORT,NULL,0,cb))
{
fprintf(fout,“failure endcommand\n”);
}

}

function party command :

//From IRP Get file Information
void procinfo(PCOMMAND command)
{
TVINFO fsclass;
SetLastError(0);
if (GetStruct(command->id,&fsclass,sizeof fsclass))
{


switch (fsclass.infoclass)
{
case FileNetworkPhysicalNameInformation:
{
fprintf(fout,“queryinfo->FileNetworkPhysicalNameInformation\n”);
printf(“queryinfo->FileNetworkPhysicalNameInformation %ws\n”,filename);
WCHAR cst[256];
int BaseLength = FIELD_OFFSET( FILE_NETWORK_PHYSICAL_NAME_INFORMATION, FileName[0] );
PFILE_NETWORK_PHYSICAL_NAME_INFORMATION pn =(PFILE_NETWORK_PHYSICAL_NAME_INFORMATION)malloczero(lendata=(BaseLength+(wcslen(cst)<<1)));
cdata=(char*)pn;
wsprintfW(cst,L"%ws",filename);
pn->FileNameLength=wcslen(cst)<<1;
wcscpy(pn->FileName,cst);
//filename represent string under forme \teste\aa and this directory exist, so resend exactly filename eg. “\teste\aa” .

}
break;
case FileAllInformation:
{



}


}

void procquerypath(PCOMMAND command)
{
int sizestruct=0,sizedata=0,sizewrite=0,sizeenum=0;
printf(“Qyerypath\n”);
if (GetSize(command->id,sizestruct,sizedata,sizewrite,sizeenum))
{
WCHAR *data=(WCHAR*)malloczero(sizedata);
if (GetData(command->id,data,sizedata))
{
int lens;
WCHAR path[256];
memcpy(path,data,sizedata);
path[lens=sizedata>>1]=0;
for (int i = 0 ; i if ((path[i]>=L’a’) && (path[i]<=L’z’))
path[i]&=~0x20;
printf(“Qyerypath %ws\n”,path);
fprintf(fout,“Qyerypath %ws\n”,path);
bool ok=false;
ok=compsecW(path,reseau);

if (!ok)
SendError(command->id,STATUS_OBJECT_NAME_NOT_FOUND);
else
{
printf(“OK path %ws\n”,path);
ULONG lenr=wcslen(reseau)<<1;
PutData(command->id,&lenr,sizeof(ULONG));
}
}
free(data);
}
}

bool compsecW(WCHAR *path,WCHAR *reseau)
{
bool ok=false;
if (wcslen(path)>=wcslen(reseau))
{
ok = true;
for (int i = 0 ; i {
WCHAR source=mj(reseau[i]);
WCHAR dest=mj(path[i]);

if (source!=dest)
ok=false;
}
}
return ok;
}

Can you help please ?

On 10/8/2010 10:57 AM, xxxxx@sivaller.no-ip.org wrote:

I use a process that manages a virtual disk files through the intermediary of a kernel driver,
and at the same time it controls the querypath.

If you are trying to implement a redirector on top of the firtual disk
file then a few points:

  1. Are you registering correctly with MUP?

  2. Do you correctly handle the open request to the redirector while
    registering with MUP?

  3. Are you handling the QUERY_PATH_EX correctly?

Pete

On the software Total Commander, I should have two valid times \teste\aa\
for viewing my files.

In explorer it does not work at all!

I do not know what to do, I turn on Windows Seven.

In user-process

Thread controller :

WCHAR reseau=L"\TESTE";

DWORD WINAPI cdisk(VOID* param)
{
hDrvThread=CreateFile(VDUM_CTL_DOSDEV_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

DWORD cb=0;
SetLastError(0);



if control(hDrvThread,IOCTL_CMD_RETREIVECOMMAND,&command,sizeof TCOMMAND,&command,sizeof TCOMMAND,iscom))
{


if (command.commande==CMD_QUERYINFORMATION)
{
ok=true;
fprintf(fout,“Query information\n”);
procinfo(&command);
}
if (command.commande==CMD_QUERYPATH)
{
ok=true;
fprintf(fout,“QueryPath\n”);
procquerypath(&command);
}



//signal for command terminated
if (!control(hDrvThread,IOCTL_CMD_ENDCOMMAND,&command.id,sizeof USHORT,NULL,0,cb))
{
fprintf(fout,“failure endcommand\n”);
}

}

function party command :

//From IRP Get file Information
void procinfo(PCOMMAND command)
{
TVINFO fsclass;
SetLastError(0);
if (GetStruct(command->id,&fsclass,sizeof fsclass))
{


switch (fsclass.infoclass)
{
case FileNetworkPhysicalNameInformation:
{
fprintf(fout,“queryinfo->FileNetworkPhysicalNameInformation\n”);
printf(“queryinfo->FileNetworkPhysicalNameInformation %ws\n”,filename);
WCHAR cst[256];
int BaseLength = FIELD_OFFSET( FILE_NETWORK_PHYSICAL_NAME_INFORMATION, FileName[0] );
PFILE_NETWORK_PHYSICAL_NAME_INFORMATION pn =(PFILE_NETWORK_PHYSICAL_NAME_INFORMATION)malloczero(lendata=(BaseLength+(wcslen(cst)<<1)));
cdata=(char*)pn;
wsprintfW(cst,L"%ws",filename);
pn->FileNameLength=wcslen(cst)<<1;
wcscpy(pn->FileName,cst);
//filename represent string under forme \teste\aa and this directory exist, so resend exactly filename eg. “\teste\aa” .

}
break;
case FileAllInformation:
{



}


}

void procquerypath(PCOMMAND command)
{
int sizestruct=0,sizedata=0,sizewrite=0,sizeenum=0;
printf(“Qyerypath\n”);
if (GetSize(command->id,sizestruct,sizedata,sizewrite,sizeenum))
{
WCHAR *data=(WCHAR*)malloczero(sizedata);
if (GetData(command->id,data,sizedata))
{
int lens;
WCHAR path[256];
memcpy(path,data,sizedata);
path[lens=sizedata>>1]=0;
for (int i = 0 ; i> if ((path[i]>=L’a’)&& (path[i]<=L’z’))
> path[i]&=~0x20;
> printf(“Qyerypath %ws\n”,path);
> fprintf(fout,“Qyerypath %ws\n”,path);
> bool ok=false;
> ok=compsecW(path,reseau);
>
>
> if (!ok)
> SendError(command->id,STATUS_OBJECT_NAME_NOT_FOUND);
> else
> {
> printf(“OK path %ws\n”,path);
> ULONG lenr=wcslen(reseau)<<1;
> PutData(command->id,&lenr,sizeof(ULONG));
> }
> }
> free(data);
> }
> }
>
> bool compsecW(WCHAR *path,WCHAR *reseau)
> {
> bool ok=false;
> if (wcslen(path)>=wcslen(reseau))
> {
> ok = true;
> for (int i = 0 ; i> {
> WCHAR source=mj(reseau[i]);
> WCHAR dest=mj(path[i]);
>
> if (source!=dest)
> ok=false;
> }
> }
> return ok;
> }
>
> Can you help please ?
>
> —
> 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


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

  1. Are you registering correctly with MUP?
    Yes , sure

  2. Do you correctly handle the open request to the redirector while registering with MUP?
    i joint party source code in this forum

  3. Are you handling the QUERY_PATH_EX correctly?
    it’s Not called because i don’t called (of head FsctlRegisterUncEX) , but called register mup (of head FsCtlRegisterMup)

if file ipc$ is opened , what do it return ioctl QUERY_PATH and IRP_MJ_CREATE ?
if file pipe (of head \pipe\srvsvc) , what do io return ioctl QUERY_PATH and IRP_MJ_CREATE ?
i haven’t file ipc$ and pipe (of head \pipe\srvsvc) in my virtual disk file system, it’s not supported !.
My virtual disk file system don’t support pipe and ipc$.
I just want MUP access my files.

When i return STATUS_OBJECT_NOT_FOUND on ipc$ and pipe , the explorer network UNC fail !

Help please ?

You shouldn’t ask this forum with any single/simple question, but you should start to study and read the documentation. The implementation of any driver is not task for several weeks as it seems you still think that it is.
Nobody will explain you the whole architecture and problems you have to deal with in several sentences or articles. Unfortunately for you, you have to do your home work.

e.g.

When i return STATUS_OBJECT_NOT_FOUND on ipc$ and pipe
Did you even read the topic “IOCTL_REDIR_QUERY_PATH Control Code” on MSDN? I cannot see here that the STATUS_OBJECT_NOT_FOUND is mentioned.
etc…

Maybe you are not aware yet, but you will have to implement Network provider in user mode land.
As a start point try to download some older WDK (like WDK for Server 2008 R2) and take look into WDK\src\filesys\smbmrx\ sample.

Bronislav Gabrhelik

On 10/11/2010 2:32 AM, xxxxx@sivaller.no-ip.org wrote:

  1. Are you registering correctly with MUP?
    Yes , sure

  2. Do you correctly handle the open request to the redirector while registering with MUP?
    i joint party source code in this forum

I don’t understand. When you call FsRtlRegisterUncProvider you will
receive an IRP_MJ_CREATE prior to this call returning. You must handle
the open correctly or this routine will fail.

  1. Are you handling the QUERY_PATH_EX correctly?
    it’s Not called because i don’t called (of head FsctlRegisterUncEX) , but called register mup (of head FsCtlRegisterMup)

OK, are you correctly handling IOCTL_REDIR_QUERY_PATH?

if file ipc$ is opened , what do it return ioctl QUERY_PATH and IRP_MJ_CREATE ?
if file pipe (of head \pipe\srvsvc) , what do io return ioctl QUERY_PATH and IRP_MJ_CREATE ?
i haven’t file ipc$ and pipe (of head \pipe\srvsvc) in my virtual disk file system, it’s not supported !.
My virtual disk file system don’t support pipe and ipc$.
I just want MUP access my files.

When i return STATUS_OBJECT_NOT_FOUND on ipc$ and pipe , the explorer network UNC fail !

You do not need to handle the ipc$ and pipe interfaces to have things
mostly work. Explorer will use the pipe interface when you browse in the
network neighborhood but it is not required for general functionality.

Pete

Help please ?


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


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

i’am sorry , i’am research , without success.
UNC don’t work in explorer Windows (bug windows UNC ???).

i return STATUS_BAD_NETWORK_PATH if nameserver invalid
or STATUS_BAD_NETWORK_NAME if ipc$ or pipe is opened.

When i valid \teste\aa on Querypath return ok only path “\teste\aa” and unc don’t work.
i have error networtk pathname not found.

New function :
void procquerypath(PCOMMAND command)
{
int sizestruct=0,sizedata=0,sizewrite=0,sizeenum=0;
printf(“Qyerypath\n”);
if (GetSize(command->id,sizestruct,sizedata,sizewrite,sizeenum))
{
WCHAR *data=(WCHAR*)malloczero(sizedata);
if (GetData(command->id,data,sizedata))
{
int lens;
WCHAR path[256];
memcpy(path,data,sizedata);
path[lens=sizedata>>1]=0;
for (int i = 0 ; i if ((path[i]>=L’a’) && (path[i]<=L’z’))
path[i]&=~0x20;
printf(“Qyerypath %ws\n”,path);
fprintf(fout,“Qyerypath %ws\n”,path);
bool ok1=false;
bool ok2=false;
ok1=compsecW(path,reseau);
ok2=true;
if (ok1)
{
for (int i = 0;i {
if (path[i]==‘P’)
if (path[i+1]==‘I’)
if (path[i+2]==‘P’)
if (path[i+3]==‘E’)
{
ok2=false;
printf(“Pas pipe\n”);
}
}
for (int i = 0;i {
if (path[i]==‘I’)
if (path[i+1]==‘P’)
if (path[i+2]==‘C’)
if (path[i+3]==‘$’)
{
ok2=false;
printf(“Pas IPC$\n”);
}
}
}
/if (ok)
{
ok=wcscmp(path,reseau)==0;
WCHAR treseau[256];
wcscpy(treseau,reseau);
treseau[wcslen(treseau)-1]=0;
if (!ok)
ok=wcscmp(path,treseau);
}
/

if (!ok1)
SendError(command->id,STATUS_BAD_NETWORK_PATH);
else
if (!ok2)
SendError(command->id,STATUS_BAD_NETWORK_NAME);
else
{
printf(“OK path %ws\n”,path);
ULONG lenr=2+(wcslen(reseau)<<1);
PutData(command->id,&lenr,sizeof(ULONG));
}
}
free(data);
}
}

Almays unc don’t work.

i solved a bug in my source code :
case FileNetworkPhysicalNameInformation:
{
fprintf(fout,“queryinfo->FileNetworkPhysicalNameInformation\n”);
printf(“queryinfo->FileNetworkPhysicalNameInformation %ws\n”,filename);
WCHAR cst[256];
wsprintfW(cst,L"\%ws",filename);
int BaseLength = FIELD_OFFSET( FILE_NETWORK_PHYSICAL_NAME_INFORMATION, FileName[0] );
PFILE_NETWORK_PHYSICAL_NAME_INFORMATION pn =(PFILE_NETWORK_PHYSICAL_NAME_INFORMATION)malloczero(lendata=(BaseLength+(wcslen(cst)<<1)+8));
cdata=(char*)pn;
//wsprintfW(cst,L"\DosDevices\Global\n:\ws",filename);

pn->FileNameLength=wcslen(cst)<<1;
wcscpy(pn->FileName,cst);

}
break;

but UNC ALWAYS DON’T WORK ! because MSDN VERY BAD DOCUMENTED in IOCTL_QUERY_PATH !
I Research always !

When FileNetworkPhysicalNameInformation is called , UNC call cleanup and close WITHOUT call IOCTL IRP_MJ_DIRECTORY (for listing file on this directory) !