Talk:UAC plug-in: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Awesome stuff. Used and approved. | Awesome stuff. Used and approved. | ||
In a domain-based network it is important to provide credentials with standart "user\domain" form (as it is displayed into runas dialog and many other places in system). | |||
Unfortunally used function CreateProcessWithLogonW() uses different form of this - "user@domain" :( | |||
So...we need a to deal with this and provide onthefly conversion. | |||
I suggest add this pice of code immediately before CreateProcessWithLogonW call (RunAs.cpp): | |||
if(swscanf(wszUName, L"%s\\%s", wszDomain, wszUser) > 1) | |||
{ | |||
wcscpy(wszUName, wszUser); | |||
wcscat(wszUName, L"@"); | |||
wcscat(wszUName, wszDomain); | |||
} | |||
...and #include <wchar.h> |
Revision as of 15:13, 24 September 2007
Awesome stuff. Used and approved.
In a domain-based network it is important to provide credentials with standart "user\domain" form (as it is displayed into runas dialog and many other places in system). Unfortunally used function CreateProcessWithLogonW() uses different form of this - "user@domain" :( So...we need a to deal with this and provide onthefly conversion. I suggest add this pice of code immediately before CreateProcessWithLogonW call (RunAs.cpp):
if(swscanf(wszUName, L"%s\\%s", wszDomain, wszUser) > 1) {
wcscpy(wszUName, wszUser); wcscat(wszUName, L"@"); wcscat(wszUName, wszDomain);
}
...and #include <wchar.h>