2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-12-22 22:08:47 +01:00

fix: DiskAdd string

This commit is contained in:
Abdur-Rahman Mansoor 2024-07-20 17:20:32 -04:00
parent 0eea7a6130
commit bb952838ca

View File

@ -118,13 +118,27 @@ proc add_nvme_disk stdcall, pci:dword
push esi
mov esi, [pci]
; NOTE: If the pcidev.num or pcidev.nsid is more than 9 then
; this fails to build the string correctly. Ignoring this issue
; for now since who has more than 9 NVMe SSDs on a desktop computer
; and a NSID bigger than 9 is also unlikely.
;
; Still, will address this problem in the future.
push 0 ; null terminator
push dword [esi + pcidev.nsid]
push "n"
push dword [esi + pcidev.num]
movzx eax, byte [esi + pcidev.nsid]
add al, "0"
mov byte [esp], al
dec esp
mov byte [esp], "n"
dec esp
movzx eax, byte [esi + pcidev.num]
add al, "0"
mov byte [esp], al
push "nvme"
invoke DiskAdd, disk_functions, esp, [esi + pcidev.nsinfo], 0
add esp, 20
mov eax, esp
invoke DiskAdd, disk_functions, eax, [esi + pcidev.nsinfo], 0
add esp, 10
test eax, eax
jz @f
invoke DiskMediaChanged, eax, 1