Hello everyone,
I am using WNetAddConnection2 to map my local drive to a remote shared folder, on which I encoutered a problem under XPE system (but not under XP Pro).
I have added the following components to XPE:
- "Basic TCP/IP"
- "File Sharing"
- "TCP/IP Networking with File Sharing and Client for MS Networks"
But the function always returns 1312, as "ERROR_NO_SUCH_LOGON_SESSION" by MSDN.
However, in the command prompt(cmd.exe), executing first the following command:
"net use \\host password /user:host\user"
It takes about 20 seconds to finish for the 1st time. Afterwards the WNetAddConnection2 will succeed.
Another strange thing is that if I use "WinExec()" in the program to execute the above command line, sometimes it does not work.
Any suggestions will be appreciated!
I am using WNetAddConnection2 to map my local drive to a remote shared folder, on which I encoutered a problem under XPE system (but not under XP Pro).
I have added the following components to XPE:
- "Basic TCP/IP"
- "File Sharing"
- "TCP/IP Networking with File Sharing and Client for MS Networks"
But the function always returns 1312, as "ERROR_NO_SUCH_LOGON_SESSION" by MSDN.
However, in the command prompt(cmd.exe), executing first the following command:
"net use \\host password /user:host\user"
It takes about 20 seconds to finish for the 1st time. Afterwards the WNetAddConnection2 will succeed.
Another strange thing is that if I use "WinExec()" in the program to execute the above command line, sometimes it does not work.
Any suggestions will be appreciated!