Home > Software engineering >  About the plug-in and Windows 7 UAC
About the plug-in and Windows 7 UAC

Time:10-23

Now I do a plug-in, mainly adopt the way of pipeline to communicate with a service of the local, but on Windows 7, after opening the UAC is to create the pipe with createFile to handle problems, looked at GetLastError returns 5, insufficient permissions, then close the UAC to normal,
Not installed inside the in VS requireAdministrator (Windows8.1 above test on the UAC is fine)

There is a problem of code is as follows:
 
_hWritePipe=CreateFile (
CommonFunc: : s2ws (serverName). C_str (),
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL.
NULL
);

Do you have any solution

CodePudding user response:

When an application creates a file across indicates a network, it is better to use GENERIC_READ | GENERIC_WRITE for dwDesiredAccess than to use GENERIC_WRITE u.s., The resulting code is faster - and because The redirector can use The cache manager and send fewer SMBs with more data. This combination also avoids The an issue where writing to a file across indicates a network can occasionally return ERROR_ACCESS_DENIED.

Seemed to suggest that you use GENERIC_READ | GENERIC_WRITE

CodePudding user response:

When creating a named pipe with a security descptor indicate that allows a user access desktop
  • Related