Re: Accessing XP Machine from a WinCE device through Network



Hi Paul,
Thanks a lot for the timely help and suggestions.After making the
modifications as per suggestions, I was able to mount the Shared drive in the
XP machine in my CE device.I am able to write/read files in the network path.
Currently I am facing some issues with loading a picture file from the
Shared Folderin the C# application running in WinCE device.
I will keep you posted on the progress or issues.
Once again , thanks a lot.

"Paul G. Tobey [eMVP]" wrote:

The remote name is the computer name AND the share name, \\WMH643-01\share.
You also have to carefully consider your choice of parameters for user name
and password. NULL means something significant to the call and it's
probably not what you think.

I used the following code successfully:

NETRESOURCE res;
res.dwScope = RESOURCE_GLOBALNET;
res.dwType = RESOURCETYPE_DISK;
res.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE;
res.dwUsage = RESOURCEUSAGE_CONNECTABLE;
res.lpLocalName = _T( "actelprj" );
res.lpRemoteName = _T( "\\\\farside\\actelprj" );
res.lpComment = NULL;
res.lpProvider = NULL;

DWORD err;
if ( ( err = WNetAddConnection3( NULL, &res, _T( "" ), _T( "GUEST" ), 0 ) )
==
ERROR_SUCCESS )
{
// Success.
}
else
{
DEBUGMSG( 1, ( TEXT( "Error in WNetAddConnection3 = %d 0x%x\r\n" ),
err, err ) );
}

Paul T.


"WinCELearner" <WinCELearner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:44EFCA1E-BCF6-407A-BF32-6A511BDCD338@xxxxxxxxxxxxxxxx
Hi Paul,
Thanks for your comments.As per your suggestion, I added the WNet
Functions.

I called the WNetAddConnection3() API with the parameters set as below:


NETRESOURCE nr;
memset(&nr,0,sizeof(nr));
nr.lpRemoteName = TEXT("\\\\WMH643-01"); //computer name to be accessed
nr.lpLocalName = L"share";
nr.dwType = RESOURCETYPE_DISK;

DWORD dwRes = WNetAddConnection3( NULL,&nr,
NULL, //
password
NULL, //
username
CONNECT_UPDATE_PROFILE);
The result of the API is an error value = 53 (ERROR_BAD_NETPATH)

I have also tried giving valid username and password for
WNetAddConnection3() API but the error is still ERROR_BAD_NETPATH.

I have also changed the NETBIOS name in the WinCE device.

Please give your thoughts on this.

Thanks a lot...




.



Relevant Pages

  • Re: Accessing XP Machine from a WinCE device through Network
    ... DWORD err; ... I called the WNetAddConnection3() API with the parameters set as below: ... I have also tried giving valid username and password for ...
    (microsoft.public.windowsce.embedded)
  • [PATCH] mmu notifiers #v7
    ... is zero, the only discussion here is to make an API that will last ... err = populate_range; ... update_mmu_cache(vma, address, entry); ...
    (Linux-Kernel)
  • Re: [PATCH] mmu notifiers #v7
    ... is zero, the only discussion here is to make an API that will last ... err = populate_range; ... update_mmu_cache(vma, address, entry); ...
    (Linux-Kernel)
  • Re: [PATCH] Export symbol ksize()
    ... Subject: crypto: api - don't use ksize ... The ksize() function is not exported to modules because it has non-standard ... by adding a ->size member to struct crypto_tfm and use that instead. ... if (err) ...
    (Linux-Kernel)

Loading