A
Armin Zingler
Hi,
I'm wondering why this declaration works:
Declare Auto Function SetupDiGetClassDevs Lib _
"setupapi.dll" Alias "SetupDiGetClassDevsA" _
(...) As IntPtr
According to the documentation, related to the function name
resolution, the "Auto" modifier means that the runtime searches
for "SetupDiGetClassDevsA" first, then for the same name
with a "W" appended, which is "SetupDiGetClassDevsAW". Both
names don't exist on a Win7 system, yet it works.
Documentation says:
"On a Unicode platform, such as Windows NT, Windows 2000, or
Windows XP, first look up the external procedure with no name
modification. If that fails, append "W" to the end of the
external procedure name and look it up again."
(from http://msdn.microsoft.com/en-us/library/4zey12w5(VS.90).aspx )
To which name does "with no name modification" refer? The original
name "SetupDiGetClassDevs" or the alias name "SetupDiGetClassDevsA"?
It must be the former, otherwise the call should fail. If so, what's
the purpose of the alias name? I reason that it's ignored if the
Auto modifier is used. Am I right or wrong?
(BTW, I didn't write the declaration myself)
I'm wondering why this declaration works:
Declare Auto Function SetupDiGetClassDevs Lib _
"setupapi.dll" Alias "SetupDiGetClassDevsA" _
(...) As IntPtr
According to the documentation, related to the function name
resolution, the "Auto" modifier means that the runtime searches
for "SetupDiGetClassDevsA" first, then for the same name
with a "W" appended, which is "SetupDiGetClassDevsAW". Both
names don't exist on a Win7 system, yet it works.
Documentation says:
"On a Unicode platform, such as Windows NT, Windows 2000, or
Windows XP, first look up the external procedure with no name
modification. If that fails, append "W" to the end of the
external procedure name and look it up again."
(from http://msdn.microsoft.com/en-us/library/4zey12w5(VS.90).aspx )
To which name does "with no name modification" refer? The original
name "SetupDiGetClassDevs" or the alias name "SetupDiGetClassDevsA"?
It must be the former, otherwise the call should fail. If so, what's
the purpose of the alias name? I reason that it's ignored if the
Auto modifier is used. Am I right or wrong?
(BTW, I didn't write the declaration myself)