File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -4366,11 +4366,23 @@ fun getVersion(stub SizeOfPointer) SizeOfPointer {
43664366 // return 0x80000000u32 // Windows 98
43674367}
43684368
4369+ // Win32 Spec: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lstrlena
43694370@dllExport('lstrlenA')
4370- fun lstrlenA(stub SizeOfPointer) SizeOfPointer {
4371- // TODO
4372- tofitaDebugLog("lstrlenA called".utf16())
4373- return 0
4371+ fun lstrlenA(lpString ConstArrayPointer<ClangChar>) Int32 {
4372+ tofitaDebugLog("lstrlenA called with lpString %8".utf16(), lpString as! UInt64)
4373+
4374+ if lpString == null {
4375+ tofitaDebugLog("> Null string pointer".utf16())
4376+ return 0
4377+ }
4378+
4379+ var length = 0
4380+ while lpString[length] != 0 as! ClangChar {
4381+ length += 1
4382+ }
4383+
4384+ tofitaDebugLog("> String length %d".utf16(), length as! UInt64)
4385+ return length
43744386}
43754387
43764388@dllExport('ReleaseMutex')
You can’t perform that action at this time.
0 commit comments