Home > Software engineering >  Windows service application can't get to the network mapping plate (expect people to solve)
Windows service application can't get to the network mapping plate (expect people to solve)

Time:10-06

Problem description:
General application can get to the mapping set, and after the open service program is to can not access, online to see some of the answers are permissions problem, but I tried all the permissions, the result is still the same for less than, if they were going to add the code? Result can save drive, code in general procedure no problem,

Source:
System (" net use P: \ \ \ \ 192.168.1.14 \ \ system ");//create network mapping plate

Vector LstDrivers;
Char szBuf [256]={0};
GetLogicalDriveStringsA (256, szBuf);
Char * pbufs=szBuf;

For (; * pbufs!='\ 0'; Pbufs +=strlen (pbufs) + 1)
{
UINT dwType=GetDriveTypeA (pbufs);
If (DRIVE_FIXED==dwType | | DRIVE_REMOTE==dwType)
{
Char szTmp2 [30]={0};
Memcpy (szTmp2 pbufs, strlen (pbufs) - 1);
LstDrivers. Push_back (string (szTmp2));//map the local disk and disk save
}
}

CodePudding user response:

CSDN without a master?

CodePudding user response:

The BBS of hair wrong?

CodePudding user response:

Sets the logged in user service to and the current logged in user,

CodePudding user response:

Said didn't get this, but your own thoughts:
1 windbg debugging, and then coordinate idapro see.net. Exe source, this time may be more, but you can talk with to the root,
The return values of 2 see.net. Exe may not know why,
3 see.net. Exe is used in the WNetEnumResource function which USES a series of functions, so may be out of the question on these functions, the function and breakpoints, and see if the return value,

CodePudding user response:

Sets the logged in user service to and the current logged in user,=="this is the first way (all set to Administrator Administrator privileges, all other rights are tried), the result is not possible, this way has been rejected, the overall feeling is still the problem, of course, just using the Windows 7, 2003, also can not, the real reason is still unknown,
Net use DOS commands, switch to WNetAddConnection2 operation also tried, the result of the return value is no problem, you can see map is successful, but can't see the map plate (this is the fundamental), because in not open services, mapping success is can see dish (K plate, such as computer mapping can see K plate),

But thank you for your reply, looking forward to have a tall person to give more inspiration ~ ~ ~ ~

CodePudding user response:

Your problem isn't it?
Use the system to run the.net use, if the program packaging application can, if service is not?
If this is the case, most likely in for service program does not have permission to access, and the application can be, so we use inter-process communication can solve,

CodePudding user response:

The building Lord solved? Has also had the same problem recently, tried many ways to improve, solve the @

CodePudding user response:

I also encountered this problem,
The administrator to run the program or service program, can't find the network mapping set,

CodePudding user response:

Maybe is blocked by a group policy Settings,

CodePudding user response:

Refer to this post, problem solving
http://www.cnblogs.com/han1988/p/3480531.html
  • Related