Author Topic: API GetVolumeNameForVolumeMountPoint  (Read 482 times)

shankle

  • Member
  • ****
  • Posts: 752
API GetVolumeNameForVolumeMountPoint
« on: March 16, 2017, 07:17:44 AM »
              3-15-2017
Thanks for any help.

Stats: uefi, windows 7 pro 64-bit, windows updates disabled,
       Goasm language, weekly maintenance, no viruses

This concerns the Microsoft API GetVolumeNameForVolumeMountPoint

FileDat    db   'C:\'
buf6       db '                                                  ',0 ; 50 bytes

   invoke GetVolumeNameForVolumeMountPoint, addr FileDat,addr buf6,50
        mov [hFile],rax
   
       No matter how I code FileDat the function fails. Taking out "addr"
       and inserting [] makes no difference.
       Yes I know about "\\?\Volume{GUID}\" in the 2nd parameter but the
       program fails before it's used.
       I have been on Google and found a reference about the API that says
       it needs to be executed twice to get it to work. The gentleman that
       wrote the article said that microsoft was just trying to get him to
       go away. I got the impression that no answer has been found.
       Neither of my computers use the old BIOS so I can't test if it works
       with the old BIOS.
       It should list the mount point for the Windows C OS.

sinsi

  • Member
  • ****
  • Posts: 996
Re: API GetVolumeNameForVolumeMountPoint
« Reply #1 on: March 16, 2017, 07:37:09 AM »
Try terminating C:\ with a zero?
I can walk on water but stagger on beer.

jj2007

  • Member
  • *****
  • Posts: 7557
  • Assembler is fun ;-)
    • MasmBasic
Re: API GetVolumeNameForVolumeMountPoint
« Reply #2 on: March 16, 2017, 07:52:36 AM »

shankle

  • Member
  • ****
  • Posts: 752
Re: API GetVolumeNameForVolumeMountPoint
« Reply #3 on: March 16, 2017, 07:56:47 AM »
Yes JJ,
But I couldn't get it to work in GoAsm.
It seems to work now but I have said that before.

This is what made it work in GOAsm.
FileDate  db 'C:\',0
Thank you Sinsi.
The rules of GoAsm still apply even though the Microsoft
documentation doesn't show it :redface: