* then it worked, set PV valid,
* else leave it 'undef'
*/
+ EXTEND(SP,1);
if (SvCUR(sv)) {
SvPOK_on(sv);
- EXTEND(SP,1);
ST(0) = sv;
XSRETURN(1);
}
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static
dXSARGS;
char ix = 'C';
char root[] = "_:\\";
+
+ EXTEND(SP,1);
while (ix <= 'Z') {
root[0] = ix++;
if (GetDriveType(root) == 1) {
root[2] = '\0';
- EXTEND(SP,1);
XSRETURN_PV(root);
}
}
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static
dXSARGS;
char *name = getlogin_buffer;
DWORD size = sizeof(getlogin_buffer);
+ EXTEND(SP,1);
if (GetUserName(name,&size)) {
- EXTEND(SP,1);
/* size includes NULL */
ST(0) = sv_2mortal(newSVpv(name,size-1));
XSRETURN(1);
}
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static
dXSARGS;
char name[MAX_COMPUTERNAME_LENGTH+1];
DWORD size = sizeof(name);
+ EXTEND(SP,1);
if (GetComputerName(name,&size)) {
- EXTEND(SP,1);
/* size does NOT include NULL :-( */
ST(0) = sv_2mortal(newSVpv(name,size));
XSRETURN(1);
}
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
/* mingw32 (and Win95) don't have NetWksta*(), so do it the old way */
char name[256];
DWORD size = sizeof(name);
+ EXTEND(SP,1);
if (GetUserName(name,&size)) {
char sid[1024];
DWORD sidlen = sizeof(sid);
SID_NAME_USE snu;
if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
dname, &dnamelen, &snu)) {
- EXTEND(SP,1);
XSRETURN_PV(dname); /* all that for this */
}
}
char dname[256];
DWORD dnamelen = sizeof(dname);
PWKSTA_INFO_100 pwi;
+ EXTEND(SP,1);
if (NERR_Success == NetWkstaGetInfo(NULL, 100, (LPBYTE*)&pwi)) {
if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
-1, (LPSTR)dname, dnamelen, NULL, NULL);
}
NetApiBufferFree(pwi);
- EXTEND(SP,1);
XSRETURN_PV(dname);
}
#endif
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static
msgbuf, sizeof(msgbuf)-1, NULL))
XSRETURN_PV(msgbuf);
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static
ST(0) = shortpath;
XSRETURN(1);
}
- XSRETURN_EMPTY;
+ XSRETURN_UNDEF;
}
static