It seems that, despite its trivial functionality, the runtime implementation
insists on converting to Unicode! This means the function is actually only
safe at PASSIVE_LEVEL.
This patch implements __toupper() as a replacement with no such hidden
nastiness and modifies callers to use that.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
if (Buffer[Index] == '\0')
break;
} else {
- Buffer[Index] = (CHAR)toupper(Buffer[Index]);
+ Buffer[Index] = __toupper(Buffer[Index]);
Index++;
}
}
return Token;
}
+static FORCEINLINE CHAR
+__toupper(
+ IN CHAR Character
+ )
+{
+ if (Character < 'a' || Character > 'z')
+ return Character;
+
+ return 'A' + Character - 'a';
+}
+
#endif // _UTIL_H