NPFormatNetworkName

Hello All:

This is rather a question for Windows 98 as I am not aware of a list
dedicated for Windows 95/98 drivers. So, I am hoping that someone has an
answer for this apparently simple question. The question is regarding the
API NPFormatNetworkName to be implemented in network provider DLL. The API
has the form:

NPFormatNetworkName(LPWSTR lpRemoteName, LPWSTR lpFormattedName,
LPDWORD lpnLength,DWORD dwFlags,DWORD dwAveCharPerLine)

For Windows 95, and also for the corresponding API on Windows NT/2000, if
the remote name is of form \hostname\sharename and flag is WNFMT_INENUM,
then I simply extract the sharename from lpRemoteName and return that for
lpFormattedName. Windows then display the mapped driver as:

sharename on hostname (:slight_smile:

However, on windows 98, windows displays it only as:

sharename (:slight_smile:

(i.e, ‘on hostname’ part isn’t displayed). Also, when Windows 98 calls this
API, dwAveCharPerLine is set to 0. The DDK documentation states that this
means no character limit is being applied on lpFormattedName. So what should
mean? Does Windows 98 expects me to return \hostname\sharename for
lpFormattedName, when dwAveCharPerLine is 0, instead of just sharename? Or
am I supposed to return ‘sharename on hostname’?

Thanks
Qasim

Thanks for the information. As it turned out, Windows 98 is inconsistent
with regard to this API when compared
with Windows 95, NT and 2000.

Specifically, Windows explorer behaves differently for Windows 95/NT/2000
and Windows 98.

Under Windows 95, NT and 2000, it is sufficient to return last component of
the share name as lpFormattedName.
For instance, given \hostname\export\dir, you can only return ‘dir’.
Explorer would then display:

‘dir on hostname\export(driveletter:)’

This is what my driver currently does. Under Windows 98, however, returing
only ‘dir’ would cause Explorer to display only:

dir (driverletter:)

Hence, one needs to return the entire input lpRemoteName as lpFormattedName
which would cause Windows 98 Explorer to display
network name same as for Windows 95 etc, that is:

‘dir on hostname\export(driveletter:)’

Doing this therefore solved the problem for me!

Thanks
Qasim

-----Original Message-----
From: Aleksandr Ryabin [mailto:xxxxx@netmanage.com]
Sent: Tuesday, May 16, 2000 6:30 AM
To: Qasim Zuhair
Cc: Aleksandr Ryabin
Subject: Re: [ntfsd] NPFormatNetworkName

At 10:34 PM 5/15/00 , you wrote:

Hello All:

This is rather a question for Windows 98 as I am not aware of a list
dedicated for Windows 95/98 drivers. So, I am hoping that someone has an
answer for this apparently simple question. The question is regarding the
API NPFormatNetworkName to be implemented in network provider DLL. The API
has the form:

NPFormatNetworkName(LPWSTR lpRemoteName, LPWSTR lpFormattedName,
LPDWORD lpnLength,DWORD dwFlags,DWORD dwAveCharPerLine)

For Windows 95, and also for the corresponding API on Windows NT/2000, if
the remote name is of form \hostname\sharename and flag is WNFMT_INENUM,
then I simply extract the sharename from lpRemoteName and return that for
lpFormattedName. Windows then display the mapped driver as:

sharename on hostname (:slight_smile:
>
>However, on windows 98, windows displays it only as:
>
>sharename (:slight_smile:

I’ve never seen the case when Win98 calls this API with WNFMT_INENUM set.
It usually called with WNFMT_CONNECTION in which case Windows takes care
of formatting it. If it did not pass to you WNFMT_INENUM you should simply
return
the input lpRemoteName in lpFormattedName.

Although I’ve noticed that if you are given something like \host\export\dir
then explorer
gets confused by multi-component share name and will show “dir on
host\export”
instead of expected “share\dir on host”. To get around this problem you can
change
directory delimiter to lets say ‘/’ that is you return in that case:
“\host\export/dir”,
then explorer will show “export/dir” on host".

I hope this helps.
Aleks

>(i.e, ‘on hostname’ part isn’t displayed). Also, when Windows 98 calls this
>API, dwAveCharPerLine is set to 0. The DDK documentation states that this
>means no character limit is being applied on lpFormattedName. So what
should
>mean? Does Windows 98 expects me to return \hostname\sharename for
>lpFormattedName, when dwAveCharPerLine is 0, instead of just sharename? Or
>am I supposed to return ‘sharename on hostname’?
>
>Thanks
>Qasim
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@ftp.com
>To unsubscribe send a blank email to $subst(‘Email.Unsub’)

>----------------------------------------------------------------------
Aleksandr Ryabin
work: xxxxx@netmanage.com (aka xxxxx@ftp.com)
home: xxxxx@aol.com