本文整理自网络,侵删。
function StrLenWide(const Str: PWideChar): Cardinal;asm {Check the first byte} cmp word ptr [eax], 0 je @ZeroLength {Get the negative of the string start in edx} mov edx, eax neg edx@ScanLoop: mov cx, [eax] add eax, 2 test cx, cx jnz @ScanLoop lea eax, [eax + edx - 2] shr eax, 1 ret@ZeroLength: xor eax, eaxend;
相关阅读 >>
Delphi 2009 之 tcategorypanelgroup[5]: headerstyle
Delphi readprocessmemory 输入进程id 输入读取地址
Delphi格式化函数format、formatdatetime和formatfloat
Delphi firedac tfddatamove 导出csv
Delphi [函数] unicode 检查字符串是否含中文字
更多相关阅读请进入《Delphi》频道 >>