Skip Menu |
 

This queue is for tickets about the Win32-NetAdmin CPAN distribution.

Report information
The Basics
Id: 14677
Status: new
Priority: 0/
Queue: Win32-NetAdmin

People
Owner: Nobody in particular
Requestors: mclaught [...] rawware.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: enhancement to GetServer
Download (untitled) / with headers
text/plain 318b
I needed additional information from GetServer(...) I added fields to the hash returned when using GetServer(...,\%hash) The keys are the names of the properties in the SERVERINFO_101 structure. I imported the source for v 0.26 into subversion, checked it out, made changes and then did a diff. Attached is that diff.
Download GetServer.diff
text/x-diff 2.6k
Index: NetAdmin/NetAdmin.xs =================================================================== --- NetAdmin/NetAdmin.xs (revision 1) +++ NetAdmin/NetAdmin.xs (working copy) @@ -1939,20 +1939,56 @@ AllocWideName((char*)SvPV(ST(0),n_a), lpwServer); AllocWideName((char*)SvPV(ST(1),n_a), lpwDomain); do { - lastError = NetServerEnum(lpwServer, 101, + lastError = NetServerEnum(lpwServer, + 101, (LPBYTE*) &pwzServerInfo101, - PREFLEN, &entriesRead, - &totalEntries, (DWORD)SvIV(ST(2)), - lpwDomain, &resumeHandle); + PREFLEN, + &entriesRead, + &totalEntries, + (DWORD)SvIV(ST(2)), + lpwDomain, + &resumeHandle); + if (lastError != 0 && lastError != ERROR_MORE_DATA) break; + + for (index = 0; index < entriesRead; ++index) { + HV* inHV; + inHV=newHV(); W2AHELPER(pwzServerInfo101[index].sv101_name, buffer, sizeof(buffer)); W2AHELPER(pwzServerInfo101[index].sv101_comment, buffer1, sizeof(buffer1)); + + hv_store((HV*)inHV, + "sv101_name",strlen("sv101_name"), + newSVpv(buffer,0),0); + + hv_store((HV*)inHV, + "sv101_comment",strlen("sv101_comment"), + newSVpv(buffer1,0),0); + + hv_store((HV*)inHV, + "sv101_platform_id",strlen("sv101_platform_id"), + newSVuv(pwzServerInfo101[index].sv101_platform_id),0); + + hv_store((HV*)inHV, + "sv101_version_major",strlen("sv101_version_major"), + newSVuv(pwzServerInfo101[index].sv101_version_major),0); + + hv_store((HV*)inHV, + "sv101_version_minor",strlen("sv101_version_minor"), + newSVuv(pwzServerInfo101[index].sv101_version_minor),0); + + hv_store((HV*)inHV, + "sv101_type",strlen("sv101_type"), + newSVuv(pwzServerInfo101[index].sv101_type),0); + + hv_store((HV*)sv, buffer, strlen(buffer), - newSVpv(buffer1,0), 0 ); + newRV(inHV),0); + } NetApiBufferFree(pwzServerInfo101); } while(lastError == ERROR_MORE_DATA);


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.