It seems that the Address operator (&) works on all data types, but the dereference operator(*) only works on number pointers - Gah!
I want to call the Windows SDK function EnumDependentServicesA, which takes a pointer to an array of ENUM_SERVICE_STATUS structures (see below) and populates it.
typedef ENUM_SERVICE_STATUS
begin
LPSTR lpServiceName;
LPSTR lpDisplayName;
SERVICE_STATUS ServiceStatus;
end;
Once the call completes, how do I dereference the LPSTR's to get the string values?
Thanks
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Dereferencing string pointer
Started by
mdayton
, Mar 26 2002 19:56
2 replies to this topic
Posted 27 March 2002 - 10:23
There's a script on 'IS5/6 Samples>Strings' to convert pointers to strings, but if I'm not mistaken, you can just substitute 'STRING' for 'LPSTR', so
typedef ENUM_SERVICE_STATUS
begin
STRING lpServiceName;
STRING lpDisplayName;
SERVICE_STATUS ServiceStatus;
end;
should work.
Ide
typedef ENUM_SERVICE_STATUS
begin
STRING lpServiceName;
STRING lpDisplayName;
SERVICE_STATUS ServiceStatus;
end;
should work.
Ide
Posted 25 May 2011 - 22:51
QUOTE (mdayton @ 2002-03-26 19:56) |
It seems that the Address operator (&) works on all data types, but the dereference operator(*) only works on number pointers - Gah! I want to call the Windows SDK function EnumDependentServicesA, which takes a pointer to an array of ENUM_SERVICE_STATUS structures (see below) and populates it. typedef ENUM_SERVICE_STATUS begin LPSTR lpServiceName; LPSTR lpDisplayName; SERVICE_STATUS ServiceStatus; end; Once the call completes, how do I dereference the LPSTR's to get the string values? Thanks ??? |
I am converting a Dev Studio 9.0 project to Installshield 2011. It seems that IS 2011 now supplies its own version of lstrlenW() which requires a string and can no longer use the pointer. And InstallShield is still unable to dereference a string pointer. But the old script that I have now requires that I dereference the pointer, which even InstallShield 2011 doesn't allow.
// In ISRTWindows.h:
// prototype number KERNEL32.lstrlenW(byval wstring);
i = 0;
while( i < EintraegeGelesen)
RtlMoveMemory( pServerStruktur,nBufferPointer,8 );
// copy address
l = pServerStruktur->name; // l is a pointer; needs to be a string value
Laenge = lstrlenW( l )*2; // calculate stringsize // now requires STRING value
if Laenge then
RtlMoveMemory( pServerName,l, Laenge); // copy servername // pointer is okay here
endif;