/////////////////////////////////////////////////////////////////////////////
// ============================================================================
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// Get hostname only (without domain name)
bool wxGetHostName(wxChar *buf, int maxSize)
{
// Get hostname only (without domain name)
bool wxGetHostName(wxChar *buf, int maxSize)
{
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
// TODO should use GetComputerNameEx() when available
// the idea is that if someone had set wxUSE_SOCKETS to 0 the code
// shouldn't use winsock.dll (a.k.a. ws2_32.dll) at all so only use this
// code if we link with it anyhow
#if wxUSE_SOCKETS
// TODO should use GetComputerNameEx() when available
// the idea is that if someone had set wxUSE_SOCKETS to 0 the code
// shouldn't use winsock.dll (a.k.a. ws2_32.dll) at all so only use this
// code if we link with it anyhow
#if wxUSE_SOCKETS
- if ( sig == wxSIGNONE )
- {
- if ( ok && rc == STILL_ACTIVE )
- {
- // there is such process => success
- return 0;
- }
- }
- else // not SIGNONE
+ //
+ // be careful to interpret rc correctly: for wxSIGNONE we return success if
+ // the process exists, for all the other sig values -- if it doesn't
+ if ( ok &&
+ ((sig == wxSIGNONE) == (rc == STILL_ACTIVE)) )
bOK = ::OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
&hToken) != 0;
bOK = ::OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
&hToken) != 0;
- tkp.PrivilegeCount = 1; // one privilege to set
- tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+ tkp.PrivilegeCount = 1; // one privilege to set
+ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
::AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
::AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,