MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / GetUserOrComputer

Method GetUserOrComputer

Source/script.cpp:10516–10525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10514}
10515
10516VarSizeType Script::GetUserOrComputer(bool aGetUser, char *aBuf)
10517{
10518 char buf[MAX_PATH]; // Doesn't use MAX_COMPUTERNAME_LENGTH + 1 in case longer names are allowed in the future.
10519 DWORD buf_size = MAX_PATH;
10520 if ( !(aGetUser ? GetUserName(buf, &buf_size) : GetComputerName(buf, &buf_size)) )
10521 *buf = '\0';
10522 if (aBuf)
10523 strcpy(aBuf, buf);
10524 return (VarSizeType)strlen(buf);
10525}
10526
10527
10528

Callers 1

GetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected