int getWStrLen(Memory memory, Address ad) {
		try {
			for (int i = 0; i < 1000; i++) {
				// if the address is negative (on the stack), you can
				// end up adding like 0xa to 0xfffffff6 and overflow, so I
				// turned this into a wrapped add
				short value = memory.getShort(ad.addWrap(2 * i));
				if (value == 0) {
					return i;
				}
				// allow tab, carriage return, and linefeed
				if (value != 0x09 && value != 0x0a && value != 0x0d &&
					(value < 0x20 || value >= 0x7f)) {
					return -1;
				}
			}
		}
		catch (MemoryAccessException e) {
			return -1;
		}
		return -1;
	}
getWStrLen

@param memory program memory to check
@param ad address where unicode string is supposed to begin
@return number of unicode chars in string, -1 if not
a unicode string.  NOTE: Only English strings are considered.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/OperandReferenceAnalyzer.java