Win32 and modules

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


Is there anything out there to make using Win32 modules (Activestate)
not require dusting off my C skills? Case in point - Win32::Service:

GetStatus(hostName, serviceName, status)
The third argument must be a hash reference that will be populated
with entries corresponding to the SERVICE_STATUS structure of the
Win32 API.

Microsoft says:


typedef struct _SERVICE_STATUS {
  DWORD dwServiceType;
  DWORD dwCurrentState;
  DWORD dwControlsAccepted;
  DWORD dwWin32ExitCode;
  DWORD dwServiceSpecificExitCode;
  DWORD dwCheckPoint;
  DWORD dwWaitHint;

Do I have remember how to do all that "or-ing" and "and-ing" again?

Re: Win32 and modules

Quoted text here. Click to load it

Yes. It's not difficult though: you don't need to know any C, just a
how & and | work.


Re: Win32 and modules

Quoted text here. Click to load it

Hi Ben,
(nice to hear from you - I've been away a while...)
Yeah - I just panicked. Seems the GetStatus function updates the
structure directly - and it looks like MS might not have combined
flags. So a Dumper that prints a decimal 16 is 0x00000020 and that's
that. I wonder if I will have to learn the & and | operators :)

Site Timeline