Windows Server 2008 R2 GetDriveType() return DRIVE_NO_ROOT_DIR and CreateDirectory() returns error c

1. I have a C++ application that uses GetDriveType() API to retrieve the

drive type for the selected drive (list of drives populated in the combo

box).

2. I’m using 3 Windows Server 2008 R2 machines e.g. A,B,C,

3. My C++ application runs on machine A.

4. Also on machine A, I have created a network drive mapped to a drive of

machine B.

5. When the C++ application is executed directly on A then the

GetDriveType() and CreateDirectory()API executes successfully for the mapped network drive and

returns DRIVE_REMOTE and creates folder on mapped drives.

6. Now I establish a remote desktop connection(MSTSC) to machine A from

machine C and run the C++ application, the GetDriveType()and CreateDirectory() API executes

successfully for the mapped network drive and returns DRIVE_REMOTE and creates folder on mapped

drives.

7. Now instead of remote desktop connection, I create a RemoteApp setup for

the C++ application (.rdp). Now when I execute the remoteapp from machine

C, the GetDriveType() API fails to execute and returns
DRIVE_NO_ROOT_DIR

8.But when both machines are in the same domain then the GetDriveType() API works properly i.e. it returns 4 (DRIVE_REMOTE) but now when we try to create directory tree on mapped drive using CreateDirectory
() API then it fails with return value FALSE.

9.We get different errors through GetLastError () for CreateDirectory () in different scenario.

    A. If we mapped drive on machine A from machine B and establish a RemoteApp to machine A from machine B.

In that case we get error code 64 that means “The specified network name is no longer available”

   B.If we mapped drive on machine A from machine B and establish a RemoteApp to machine A from machine C.

In that case we get error codes,

     a) 1311 that means “There are currently no logon servers available to service the logon request”.

     b) 1364 that means “A specified authentication package is unknown”.

     c) 1326 that means “Logon failure: unknown user name or bad password”.

Can anybody please help me with the below questions –

1. Is there any limitation to RemoteApp for network drive?

2. What is the difference between RemoteApp and Remote Desktop Connection

that causes the change in behavior?

I also tried Solutions which are mentioned at the following forums,

http://www.eggheadcafe.com/software/aspnet/33891358/vista-getdrivetype-return-drivenorootdir-on-network-mapped-drives.aspx
http://us.generation-nt.com/answer/vista-getdrivetype-return-drive-no-root-dir-network-mapped-drives-help-28505542.html

 

but none of them worked for me.