Ok so i found out why it was returning a zero. First of all the dword values are/were stored using ASCII not unicode. In case someone else runs into the same problem, the correct declaration is as follows:
Private Declare PtrSafe Function RegQueryValueExDword Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As LongPtr, ByVal lpValueName As String, ByVal lpReserved As LongPtr, lpType As LongPtr, lpData As Any, lpcbData As LongPtr) As LongPtr