/* there's a drive letter there */
firstp = pathp+2;
pathHasDrive = 1;
- }
- else {
+ } else {
firstp = pathp;
pathHasDrive = 0;
}
return 0;
}
- GetCurrentDirectory(sizeof(origPath), origPath);
+ GetCurrentDirectoryA(sizeof(origPath), origPath);
doSwitch = 0;
if (pathHasDrive && (*pathp & ~0x20) != (origPath[0] & ~0x20)) {
newPath[0] = *pathp;
newPath[1] = ':';
newPath[2] = 0;
- if (!SetCurrentDirectory(newPath)) {
+ if (!SetCurrentDirectoryA(newPath)) {
code = GetLastError();
return code;
}
}
/* now get the absolute path to the current wdir in this drive */
- GetCurrentDirectory(sizeof(tpath), tpath);
+ GetCurrentDirectoryA(sizeof(tpath), tpath);
strcpy(outPathp, tpath+2); /* skip drive letter */
/* if there is a non-null name after the drive, append it */
if (*firstp != 0) {
/* finally, if necessary, switch back to our home drive letter */
if (doSwitch) {
- SetCurrentDirectory(origPath);
+ SetCurrentDirectoryA(origPath);
}
return 0;
return 0;
}
-afs_int32 util_GetInt32 (char *as, afs_int32 *aval)
-{
- register long total;
- register int tc;
- int base;
- int negative;
-
- total = 0; /* initialize things */
- negative = 0;
-
- /* skip over leading spaces */
- while (tc = *as) {
- if (tc != ' ' && tc != '\t') break;
- }
-
- /* compute sign */
- if (*as == '-') {
- negative = 1;
- as++; /* skip over character */
- }
-
- /* compute the base */
- if (*as == '0') {
- as++;
- if (*as == 'x' || *as == 'X') {
- base = 16;
- as++;
- }
- else base = 8;
- }
- else base = 10;
-
- /* compute the # itself */
- while(tc = *as) {
- if (!ismeta(tc, base)) return -1;
- total *= base;
- total += getmeta(tc);
- as++;
- }
-
- if (negative) *aval = -total;
- else *aval = total;
- return 0;
-}
-
char *cm_mount_root="afs";
char *cm_slash_mount_root="/afs";
char *cm_back_slash_mount_root="\\afs";
char *pmount=mountRoot;
DWORD len=sizeof(mountRoot)-1;
printf("int mountroot \n");
- if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY, 0, KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS)
- || (RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS)
+ if ((RegOpenKeyExA(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY, 0,
+ (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS)
+ || (RegQueryValueExA(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS)
|| (len==sizeof(mountRoot)-1)
)
strcpy(mountRoot, "\\afs");
strcpy(cm_back_slash_mount_root+1,pmount);
cm_back_slash_mount_root[0]='\\';
}
-