This is a patch to go from libwin32 v0.171 to v0.172. This is yet another unofficial patch that corresponds to the libwin32 that ships with ActivePerl build 626. Apply using GNU patch as follows: # get libwin32-0.16.zip, libwin32-0.171.patch, libwin32-0.172.patch first unzip libwin32-0.16.zip rename libwin32-0.16 libwin32-0.172 cd libwin32-0.172 patch -p1 -N < ../libwin32-0.171.patch patch -p1 -N < ../libwin32-0.172.patch Note that the patch for v0.171 must be applied first. Enjoy. Gurusamy Sarathy gsar@ActiveState.com ------------------------------------8<------------------------------------ diff -urN libwin32-0.171/APIFile/File.pm libwin32-0.172/APIFile/File.pm --- libwin32-0.171/APIFile/File.pm Mon May 14 00:12:25 2001 +++ libwin32-0.172/APIFile/File.pm Mon May 14 00:14:07 2001 @@ -839,7 +839,7 @@ C<$sOldFileName> is the path to the file to be copied. C<$sNewFileName> is the path to where the file should be copied. -Note that you can E just specify a path to a directory in +Note that you can B just specify a path to a directory in C<$sNewFileName> to copy the file to that directory using the same file name. @@ -907,8 +907,8 @@ Locking this for exclusive access doesn't prevent access to the physical drive that the partition is on so other processes can still access the raw sectors that way. Locking this for exclusive -access E prevent other processes from opening the same raw -partition and E prevent access to the file system on it. It +access B prevent other processes from opening the same raw +partition and B prevent access to the file system on it. It even prevents the current process from accessing the file system on that partition. @@ -1043,7 +1043,7 @@ =item C Deletes the named file. Compared to Perl's C, C -has the advantage of not deleting read-only files. For E +has the advantage of not deleting read-only files. For B versions of Perl, C silently calls C whether it needs to or not before deleting the file so that files that you have protected by marking them as read-only are not always protected from @@ -1540,7 +1540,7 @@ a sample of this format]. C<$lTargetBuf> is the size [in bytes] of the buffer to allocate for -C<$osTargetPath>. See L for more information. +C<$osTargetPath>. See L for more information. C<$olTargetLen> is set to the number of bytes written to C<$osTargetPath> but you can also use C @@ -1582,7 +1582,7 @@ =item C<$uOldMode= SetErrorMode( $uNewMode )> -Sets the mode controlling system error handling E returns the +Sets the mode controlling system error handling B returns the previous mode value. Both C<$uOldMode> and C<$uNewMode> will have zero or more of the following bits set: @@ -2249,7 +2249,7 @@ bytes] where the formatting should begin. =item C<$uLength> - + The length [in bytes] of the section to be formatted. =back diff -urN libwin32-0.171/APINet/Changes libwin32-0.172/APINet/Changes --- libwin32-0.171/APINet/Changes Mon May 14 00:12:25 2001 +++ libwin32-0.172/APINet/Changes Mon May 14 00:14:07 2001 @@ -1,5 +1,10 @@ Revision history for Perl extension Win32API::Net +0.09 Tue Sep 05 2000 + - fixed yet another memory leak pointed out again by Eamon Doyle. + Macro HV_STORE_AV used newRV_inc instead of newRV_noinc + - Corrected minor typo in documentation + 0.081 Mon May 22 20:38:11 2000 - support for building under Perl v5.6.0. - fixed a leak due to improper freeing in UserGetInfo() diff -urN libwin32-0.171/APINet/Net.html libwin32-0.172/APINet/Net.html --- libwin32-0.171/APINet/Net.html Mon May 14 00:12:25 2001 +++ libwin32-0.172/APINet/Net.html Mon May 14 00:14:08 2001 @@ -6,1749 +6,1558 @@ +

-

NAME

+

NAME

+

Win32API::Net - Perl interface to the Windows NT LanManager API account management functions.

-Win32API::Net - Perl interface to the Windows NT LanManager API account -management functions. - -


-

SYNOPSIS

-

-use Win32API::Net; - +

SYNOPSIS

+

use Win32API::Net;


-

NOTE ON VERSIONS PRIOR TO 0.08

-

-As of version 0.08 of this module, the behaviour relating to empty strings +

NOTE ON VERSIONS PRIOR TO 0.08

+

As of version 0.08 of this module, the behaviour relating to empty strings in input hashes has changed. The old behaviour converted such strings to the NULL pointer. The underlying API uses this value as an indication to not change the value stored for a given field. This meant that you were not -able to clear (say) the logonScript field for a user using -UserSetInfo(). - -

-The new behaviour is to leave the string as an empty C string which will +able to clear (say) the logonScript field for a user using UserSetInfo().

+

The new behaviour is to leave the string as an empty C string which will allow fields to be cleared. To pass a NULL pointer to the underlying API call (and thus, to leave the field as it was), you need to set the -corresponding field to undef. - -

-WARNING: THIS IS AN INCOMPATIBLE CHANGE. -EXISTING SCRIPTS THAT RELIED ON PRIOR BEHAVIOR MAY NEED TO BE MODIFIED. - +corresponding field to undef.

+

WARNING: THIS IS AN INCOMPATIBLE CHANGE. +EXISTING SCRIPTS THAT RELIED ON PRIOR BEHAVIOR MAY NEED TO BE MODIFIED.


-

DESCRIPTION

-

-Win32API::Net provides a more complete wrapper for the account management +

DESCRIPTION

+

Win32API::Net provides a more complete wrapper for the account management parts of the NT LanManager API than do other similar packages. Most of what -you can achieve with the native C++ API is possible with this package - -albeit in a more Perl like manner by using references to pass information -to and from functions. - -

-For an understanding of the environment in which these functions operate -see -DATA STRUCTURES. - -

-The following groups of functions are available: - -

-
NET USER FUNCTIONS
-
NET GROUP FUNCTIONS
-
NET LOCAL GROUP FUNCTIONS
-
NET GET FUNCTIONS
-
-

-All functions return 0 on failure and 1 on success. Use the -Win32::GetLastError() function to find out more information on why a function failed. In -addition, some functions that take a hash reference to pass information in -(e.g. UserAdd()) have a last argument that will allow more detailed information on which -key/value pair was not properly specified. - -

-


-

Using References

-

-References to hashes and arrays are used throughout this package to pass -information into and out of functions. - +you can achieve with the native C++ API is possible with this package - albeit +in a more Perl like manner by using references to pass information to and +from functions.

+

For an understanding of the environment in which these functions operate see +DATA STRUCTURES.

+

The following groups of functions are available:

+
+
NET USER FUNCTIONS
+
+
NET GROUP FUNCTIONS
+
+
NET LOCAL GROUP FUNCTIONS
+
+
NET GET FUNCTIONS
+
+
+

All functions return 0 on failure and 1 on success. Use the +Win32::GetLastError() function to find out more information on why a +function failed. In addition, some functions that take a hash reference +to pass information in (e.g. UserAdd()) have a last argument that will +allow more detailed information on which key/value pair was not properly +specified.

+

+

Using References

+

References to hashes and arrays are used throughout this package to pass +information into and out of functions.

-
Using Hash References
-

+

Using Hash References
+
Where a hash reference is required you can use anything that evaluates to a hash reference. e.g. - -

-

        $href = \%someHash;
-        UserAdd(server, 2, $hRef);
-
-

-Or more directly: - -

-

        UserAdd(server, 2, \%someHash);
-
-
Using Array references
-

+

+        $href = \%someHash;
+        UserAdd(server, 2, $hRef);
+

Or more directly:

+
+        UserAdd(server, 2, \%someHash);
+

+
Using Array references
+
Array references are used in a similar manner to hash references. e.g. - -

-

        $aref = \@someArray;
-        UserEnum(server, $aref);
-
-

-Or more directly: - -

-

        UserEnum(server, \@someArray);
-
-
-

-Please note: Any *Get*() or *Enum() operation will first clear the contents of the input hash or array being -referenced. - -

-See EXAMPLES and the test.pl script for examples of usage. - +

+        $aref = \@someArray;
+        UserEnum(server, $aref);
+

Or more directly:

+
+        UserEnum(server, \@someArray);
+

+

Please note: Any *Get*() or *Enum() operation will first clear the +contents of the input hash or array being referenced.

+

See EXAMPLES and the test.pl script for examples of usage.


-

DATA STRUCTURES

-

-Most the the functions in the underlying API allow the programmer to pass +

DATA STRUCTURES

+

Most the the functions in the underlying API allow the programmer to pass specify at runtime the amount of information that is supplied to the -function. For example, the NetUserGetInfo() call allows the programmer to specify levels of 0, 1, 2, 3 (and others). -Having specified this level, the function returns a structure that will -contain different fields. For a level 0, the function returns a structure that has only one field. For a supplied -level of 1, the function returns a structure with 8 fields. The programmer needs to know in advance what fields should be -provided or will be returned for a given level. This mechanism works very -will since it effectively overloads functions without having to use -different function prototypes. Perl provides better higher level data -structures in the form of arrays and hashes. This package uses hashes as -the means to pass these variable size structure into and out of functions. - -

-For any function that takes a reference to a hash as input, the programmer +function. For example, the NetUserGetInfo() call allows the programmer to +specify levels of 0, 1, 2, 3 (and others). Having specified this level, the +function returns a structure that will contain different fields. For a +level 0, the function returns a structure that has only one field. For a +supplied level of 1, the function returns a structure with 8 fields. The +programmer needs to know in advance what fields should be provided or will +be returned for a given level. This mechanism works very will since it +effectively overloads functions without having to use different function +prototypes. Perl provides better higher level data structures in the form +of arrays and hashes. This package uses hashes as the means to pass these +variable size structure into and out of functions.

+

For any function that takes a reference to a hash as input, the programmer is expected to provide appropriate keys and corresponding values as well as the level parameter. The called function will then takes the values out of the supplied hash and build the approprite structure to pass to the -underlying API function. - -

-For any function that takes a reference to a hash to recieve output, the +underlying API function.

+

For any function that takes a reference to a hash to recieve output, the function will first clear any keys an corresponding values in the supplied hash. It will call the underlying API call and will then return in the hash -any keys and values that are applicable at the requested level. - -

-Example: - -

-The UserGetInfo() can takes a number of levels. If called with level 0 +any keys and values that are applicable at the requested level.

+

Example:

+

The UserGetInfo() can takes a number of levels. If called with level 0 the supplied hash will, on return from the function, contain a single key -and value - namely name/requested-users-name. If called with a level of 1 the supplied hash will, on return from the function, contain 8 keys and -values. The returned keys are name, password, passwordAge, -priv, homeDir, comment, flags, scriptPath. See -USER INFO FIELDS for more information on what these represent. - -

-


-

Exports

-

-By default, Win32API::Net exports no symbols into the callers namespace. -The following tags can be used to selectively import symbols into the main -namespace. - -

-
:User
-

-Exports all symbols needed for the User*() functions. See NET USER FUNCTIONS. - -

:Get
-

-Exports all symbols needed for the Get*() functions. See NET GET FUNCTIONS. - -

:Group
-

-Exports all symbols needed for the Group*() functions. See NET GROUP FUNCTIONS. - -

:LocalGroup
-

-Exports all symbols needed for the LocalGroup*() functions. See NET LOCAL GROUP FUNCTIONS. - -

-

-


-

NET USER FUNCTIONS

-

-The User*() functions operate on NT user accounts. - -

-Administrator or Account Operator group membership is required to +and value - namely name/requested-users-name. If called with a level +of 1 the supplied hash will, on return from the function, contain 8 keys +and values. The returned keys are name, password, passwordAge, +priv, homeDir, comment, flags, scriptPath. See +USER INFO FIELDS for more information on what these represent.

+

+


+

EXPORTS

+

By default, Win32API::Net exports no symbols into the callers namespace. +The following tags can be used to selectively import symbols into the +main namespace.

+
+
:User
+
+Exports all symbols needed for the User*() functions. +See NET USER FUNCTIONS. +

+
:Get
+
+Exports all symbols needed for the Get*() functions. +See NET GET FUNCTIONS. +

+
:Group
+
+Exports all symbols needed for the Group*() functions. +See NET GROUP FUNCTIONS. +

+
:LocalGroup
+
+Exports all symbols needed for the LocalGroup*() functions. +See NET LOCAL GROUP FUNCTIONS. +

+

+


+

NET USER FUNCTIONS

+

The User*() functions operate on NT user accounts.

+

Administrator or Account Operator group membership is required to successfully execute most of these functions on a remote server or on a computer that has local security enabled. Administrator privileges are -required to add an Administrator Privilege account. There are some +required to add an Administrator Privilege account. There are some exceptions to this whereby a user can change some of their own settings where these don't conflict with 'administrative information' (e.g. full -name). - -

-The server field can be the empty string, in which case the function defaults to -running on the local computer. If you leave this field blank then you -should ensure that you are running the function on a PDC or BDC for your -current domain. Use the support function GetDCName() to find out what the domain controller is, should you not be running this -on the PDC. - -

-All functions in this section are 'DOMAIN functions'. This means that, for -example, the UserGetLocalGroups() function actually lists the domain's local groups of which the named user -is a member. - -

-The following functions are available. - -

-


-

UserAdd(server, level, hash, error)

-

-Add a new user account. The user name is taken from the name-key's value in the supplied hash. - +name).

+

The server field can be the empty string, in which case the function +defaults to running on the local computer. If you leave this field blank +then you should ensure that you are running the function on a PDC or BDC +for your current domain. Use the support function GetDCName() to find out +what the domain controller is, should you not be running this on the PDC.

+

All functions in this section are 'DOMAIN functions'. This means that, +for example, the UserGetLocalGroups() function actually lists the +domain's local groups of which the named user is a member.

+

The following functions are available.

+

+

UserAdd(server, level, hash, error)

+

Add a new user account. The user name is taken from the name-key's +value in the supplied hash.

-
server - Scalar String
-

+

server - Scalar String
+
The server on which to add the account. - -
level - Scalar Int
-

-Level of information provided in hash. This can be either 1, 2 or 3. See USER INFO LEVELS. - -

hash - Hash Reference
-

+

+
level - Scalar Int
+
+Level of information provided in hash. This can be either 1, 2 or 3. +See USER INFO LEVELS. +

+
hash - Hash Reference
+
The information to use to add this account. This should have all the -appropriate keys and values required for level. - -
error - Scalar Int
-

+appropriate keys and values required for level. +

+
error - Scalar Int
+
Provides information on which field in the hash was not properly specified. -See USER FIELD ERRORS for more information about what values this can take. - -
-

-


-

UserChangePassword(server, user, old, new)

-

-Changes the password for user. If the policy of the machine/domain only allows password changes if the user is logged on then the user +See USER FIELD ERRORS for more information about what values this can +take. +

+

+

UserChangePassword(server, user, old, new)

+

Changes the password for user. If the policy of the machine/domain +only allows password changes if the user is logged on then the user must be logged on to execute this function. With Administrator or Account Operator privilege you can use this function to change anyone's password, -so long as you know the old password. - -

-
server - Scalar String
-

-The server on which to change the password. - -

user - Scalar String
-

-The name of the user whose password is being changed. - -

old - Scalar String
-

-The existing password for user. - -

new - Scalar String
-

-The new password for user. - -

-

-


-

UserDel(server, user)

-

-Deletes the specified user account. Administrator or Account Operator privilege is required to execute -this function. - -

-
server - Scalar String
-

-The server on which to delete the user. - -

user - Scalar String
-

-The user account to delete. - -

-

-


-

UserEnum(server, array[, filter])

-

-Enumerates all the accounts on server that satisfy filter. Unlike the -NetUserEnum() function in the API, this function does not allow you to specify a level -(internally it is hardcoded to 0). In Perl it is trivial to implement the -equivalent function (should you need it) - see -Example 1. - -

-
server - Scalar String
-

-The server on which to enumerate the accounts satisfying filter. - -

array - Array Reference
-

-The array that will hold the names of all users on server whose accounts match filter. - -

filter - Scalar Int (optional)
-

-The filter to apply (see USER ENUM FILTER). This argument is optional and if not present a default of FILTER_NORMAL_ACCOUNT is used. - -

-

-


-

UserGetGroups(server, user, array)

-

-Get the global groups for which user is a member. It returns the group names in array. Unlike the NetUserGetGroups() function in the API, this function does not allow you to specify a level -(internally is hardcoded to 0). In Perl it is trivial to implement the -equivalent function (in the unlikely event that you might need it). - +so long as you know the old password.

-
server - Scalar String
-

-The server from which to get the groups of which user is a member. - -

user - Scalar String
-

-The user whose group membership you wish to examine. - -

array - Scalar String
-

-The array that will contain the group names to which user belongs. - -

-

-


-

UserGetInfo(server, user, level, hash)

-

-Returns the information at the specified level for the named user -in hash. - +

server - Scalar String
+
+The server on which to change the password. +

+
user - Scalar String
+
+The name of the user whose password is being changed. +

+
old - Scalar String
+
+The existing password for user. +

+
new - Scalar String
+
+The new password for user. +

+

+

UserDel(server, user)

+

Deletes the specified user account. Administrator or Account Operator +privilege is required to execute this function.

+
+
server - Scalar String
+
+The server on which to delete the user. +

+
user - Scalar String
+
+The user account to delete. +

+

+

UserEnum(server, array[, filter])

+

Enumerates all the accounts on server that satisfy filter. Unlike the +NetUserEnum() function in the API, this function does not allow you +to specify a level (internally it is hardcoded to 0). In Perl it is +trivial to implement the equivalent function (should you need it) - see +Example 1.

+
+
server - Scalar String
+
+The server on which to enumerate the accounts satisfying filter. +

+
array - Array Reference
+
+The array that will hold the names of all users on server whose +accounts match filter. +

+
filter - Scalar Int (optional)
+
+The filter to apply (see USER ENUM FILTER). This argument is optional +and if not present a default of FILTER_NORMAL_ACCOUNT is used. +

+

+

UserGetGroups(server, user, array)

+

Get the global groups for which user is a member. It returns the group +names in array. Unlike the NetUserGetGroups() function in the API, +this function does not allow you to specify a level (internally is +hardcoded to 0). In Perl it is trivial to implement the equivalent function +(in the unlikely event that you might need it).

-
server - Scalar String
-

-The server from which to get the requested information about user. - -

user - Scalar String
-

-The user whose information you want. - -

level - Scalar Int
-

-One of: 0, 1, 2, 3, 10, 11 and 20. See USER INFO LEVELS. - -

hash - Hash Reference
-

+

server - Scalar String
+
+The server from which to get the groups of which user is a member. +

+
user - Scalar String
+
+The user whose group membership you wish to examine. +

+
array - Scalar String
+
+The array that will contain the group names to which user belongs. +

+

+

UserGetInfo(server, user, level, hash)

+

Returns the information at the specified level for the named user +in hash.

+
+
server - Scalar String
+
+The server from which to get the requested information about user. +

+
user - Scalar String
+
+The user whose information you want. +

+
level - Scalar Int
+
+One of: 0, 1, 2, 3, 10, 11 and 20. See USER INFO LEVELS. +

+
hash - Hash Reference
+
The hash that will contain the keys and values for the information -requested. See USER INFO FIELDS for information about which keys are present in a given level. - -
-

-


-

UserGetLocalGroups(server, user, array[, flags])

-

-Gets the names of the local groups of which user is a member. Unlike the NetUserEnum() function in the API, this function does not allow you to specify a level. -Since the underlying API restricts you to level 0 there really isn't any -need to include it... - -

-
server - Scalar String
-

-The server from which to get the local groups of which user is a member. - -

user - Scalar String
-

-The user whose local group membership you wish to enumerate. - -

array - Array Reference
-

-The array that will hold the names of the local groups to which user +requested. See USER INFO FIELDS for information about which keys are +present in a given level. +

+

+

UserGetLocalGroups(server, user, array[, flags])

+

Gets the names of the local groups of which user is a member. Unlike +the NetUserEnum() function in the API, this function does not allow you +to specify a level. Since the underlying API restricts you to level 0 there +really isn't any need to include it...

+
+
server - Scalar String
+
+The server from which to get the local groups of which user is a member. +

+
user - Scalar String
+
+The user whose local group membership you wish to enumerate. +

+
array - Array Reference
+
+The array that will hold the names of the local groups to which user belongs. - -
flags - Scalar Int <em>(optional)</em>
-

-Either Win32API::Net::LG_INCLUDE_INDIRECT() or 0. if flags is omitted, the function internally uses 0. Specifying LG_INCLUDE_INDIRECT() -will include in the list the names of the groups of which the user is indirectly a member (e.g. by being in a global group that is a member of -a local group). - -

-This field can take no other values. - -

-

-


-

UserModalsGet()

-

-This function is not currently implemented. - -

-


-

UserModalsSet()

-

-This function is not currently implemented. - -

-


-

UserSetGroups(server, user, array)

-

-Sets the (global) group membership for user to the specified groups. Unlike the API function NetUserSetGroups(), this function does not take a -level parameter (mainly because this option is largely redundant). - -

-
server - Scalar String
-

-The server on which you wish to set the group membership for user. - -

user - Scalar String
-

-The user whose group membership you wish to set. - -

array - Array Reference
-

-The array containing the (global) group names to set the users membership of. - -

-

-This function will fail if any of the group names specified do not exist. - -

-


-

UserSetInfo(server, user, level, hash, error)

-

-Sets the info for user according to the information contained in hash -for level (see USER INFO LEVELS). - -

-
server - Scalar String
-

-The server on which you wish to change the info for user. - -

user - Scalar String
-

-The user whose info you wish to change. - -

level - Scalar Int
-

+

+
flags - Scalar Int <em>(optional)</em>
+
+Either Win32API::Net::LG_INCLUDE_INDIRECT() or 0. if flags is +omitted, the function internally uses 0. Specifying LG_INCLUDE_INDIRECT() +will include in the list the names of the groups of which the user is +indirectly a member (e.g. by being in a global group that is a member of a +local group). +

This field can take no other values.

+

+

+

UserModalsGet()

+

This function is not currently implemented.

+

+

UserModalsSet()

+

This function is not currently implemented.

+

+

UserSetGroups(server, user, array)

+

Sets the (global) group membership for user to the specified groups. +Unlike the API function NetUserSetGroups(), this function does not take a +level parameter (mainly because this option is largely redundant).

+
+
server - Scalar String
+
+The server on which you wish to set the group membership for user. +

+
user - Scalar String
+
+The user whose group membership you wish to set. +

+
array - Array Reference
+
+The array containing the (global) group names to set the users +membership of. +

+

This function will fail if any of the group names specified do not exist.

+

+

UserSetInfo(server, user, level, hash, error)

+

Sets the info for user according to the information contained in hash +for level (see USER INFO LEVELS).

+
+
server - Scalar String
+
+The server on which you wish to change the info for user. +

+
user - Scalar String
+
+The user whose info you wish to change. +

+
level - Scalar Int
+
One of 0, 1, 2, 3, or 20 (according to Microsoft documentation). In practice, you can use all the 10xx levels as well to change most of the -individual properties of the named user - although this may not be supported in future... - -
hash - Hash Reference
-

+individual properties of the named user - although this may not be +supported in future... +

+
hash - Hash Reference
+
The hash that will contain the necessary key/value pairs required for -level (see USER INFO LEVELS). - -
error - Scalar Int
-

-Provides information on which field in hash were not properly specified. See USER FIELD ERRORS for more information about what values can be returned in this field. - -

-

-


-

NET GROUP FUNCTIONS

-

-The Group*() functions all operate only on global groups. To modify local groups, use -the corresponding LocalGroup*() functions. - -

-Administrator or Account Operator group membership is required to -successfully execute most of these functions on a remote server or on a -computer that has local security enabled. - -

-The server field can be the empty string, in which case the function defaults to -running on the local computer. If you leave this field blank then you -should ensure that you are running the function on a PDC or BDC for your -current domain. Use the support function GetDCName() to find out what the domain controller is, should you not be running this -on the PDC. - -

-The following functions are available. - -

-


-

GroupAdd(server, level, hash, error)

-

-Adds the specified group. - -

-
server - Scalar String
-

-The server on which to add the group. - -

level - Scalar String
-

-The level of information contained in hash. This can be one of 0, 1 or 2. See GROUP INFO LEVELS. - -

hash - Hash Reference
-

-A hash containing the required key/value pairs for level. - -

error - Scalar Int
-

-Provides information on which field in hash was not properly specified. See GROUP FIELD ERRORS for more information about what values can be returned in this field. - -

-

-


-

GroupAddUser(server, group, user)

-

-Adds the specified user to the specified group. - -

-
server - Scalar String
-

-The server on which to add the user to group. - -

group - Scalar String
-

-The group to add the user to. - -

user - Scalar String
-

-The user to add to group. - -

-

-


-

GroupDel(server, group)

-

-Deletes the specified global group. - -

-
server - Scalar String
-

-The server on which to delete the named group. - -

group -Scalar String
-

-The group to delete. - -

-

-


-

GroupDelUser(server, group, user)

-

-Deletes the specified user from the specified group. - -

-
server - Scalar String
-

-The server on which to delete user from group. - -

group - Scalar String
-

-The group from which to delete user. - -

user - Scalar String
-

-The user to delete from group. - -

-

-


-

GroupEnum(server, array)

-

-Enumerates all the global groups on the server. Unlike the API call -NetGroupEnum(), this function does not allow you to specify a level (internally it is -hardcoded to 0). In Perl it is trivial to implement the equivalent function -(should you need it). - +level (see USER INFO LEVELS). +

+
error - Scalar Int
+
+Provides information on which field in hash were not properly +specified. See USER FIELD ERRORS for more information about what +values can be returned in this field. +

+

+


+

NET GROUP FUNCTIONS

+

The Group*() functions all operate only on global groups. To modify +local groups, use the corresponding LocalGroup*() functions.

+

Administrator or Account Operator group membership is required to +successfully execute most of these functions on a remote server or on +a computer that has local security enabled.

+

The server field can be the empty string, in which case the function +defaults to running on the local computer. If you leave this field blank +then you should ensure that you are running the function on a PDC or BDC +for your current domain. Use the support function GetDCName() to find out +what the domain controller is, should you not be running this on the PDC.

+

The following functions are available.

+

+

GroupAdd(server, level, hash, error)

+

Adds the specified group.

+
+
server - Scalar String
+
+The server on which to add the group. +

+
level - Scalar String
+
+The level of information contained in hash. This can be one of 0, 1 +or 2. See GROUP INFO LEVELS. +

+
hash - Hash Reference
+
+A hash containing the required key/value pairs for level. +

+
error - Scalar Int
+
+Provides information on which field in hash was not properly specified. +See GROUP FIELD ERRORS for more information about what values can be +returned in this field. +

+

+

GroupAddUser(server, group, user)

+

Adds the specified user to the specified group.

+
+
server - Scalar String
+
+The server on which to add the user to group. +

+
group - Scalar String
+
+The group to add the user to. +

+
user - Scalar String
+
+The user to add to group. +

+

+

GroupDel(server, group)

+

Deletes the specified global group.

+
+
server - Scalar String
+
+The server on which to delete the named group. +

+
group -Scalar String
+
+The group to delete. +

+

+

GroupDelUser(server, group, user)

+

Deletes the specified user from the specified group.

+
+
server - Scalar String
+
+The server on which to delete user from group. +

+
group - Scalar String
+
+The group from which to delete user. +

+
user - Scalar String
+
+The user to delete from group. +

+

+

GroupEnum(server, array)

+

Enumerates all the global groups on the server. Unlike the API call +NetGroupEnum(), this function does not allow you to specify a level +(internally it is hardcoded to 0). In Perl it is trivial to implement +the equivalent function (should you need it).

-
server - Scalar String
-

+

server - Scalar String
+
The server on which to enumerate the (global) groups. - -
array - Array Reference
-

-An array that, on return, will contain the group names. - -

-

-


-

GroupGetInfo(server, group, level, hash)

-

-Retrieves level information for group returning information in -hash. - -

-
server - Scalar String
-

-The server from which to get the group information. - -

group - Scalar String
-

-The group whose information you wish to obtain. - -

level - Scalar Int
-

-The level of information you wish to retrieve. This can be one of 1, 2 or 3. See GROUP INFO LEVELS. - -

hash - Hash Reference
-

+

+
array - Array Reference
+
+An array that, on return, will contain the group names. +

+

+

GroupGetInfo(server, group, level, hash)

+

Retrieves level information for group returning information in +hash.

+
+
server - Scalar String
+
+The server from which to get the group information. +

+
group - Scalar String
+
+The group whose information you wish to obtain. +

+
level - Scalar Int
+
+The level of information you wish to retrieve. This can be one of 1, 2 +or 3. See GROUP INFO LEVELS. +

+
hash - Hash Reference
+
The hash that will contain the information. - -
-

-


-

GroupGetUsers(server, group, array)

-

-Returns (in array) the users belonging to group. Unlike the API call NetGroupGetUsers(), this function does not allow you to specify a level (internally it is -hardcoded to 0). In Perl it is trivial to implement the equivalent function -(should you need it). - -

-
server - Scalar String
-

-The server from which to get the group information. - -

group - Scalar String
-

-The group whose users you wish to obtain. - -

array - Array Reference
+

+

GroupGetUsers(server, group, array)

+

Returns (in array) the users belonging to group. Unlike the API +call NetGroupGetUsers(), this function does not allow you to specify +a level (internally it is hardcoded to 0). In Perl it is trivial to +implement the equivalent function (should you need it).

+
+
server - Scalar String
+
+The server from which to get the group information. +

+
group - Scalar String
+
+The group whose users you wish to obtain. +

+
array - Array Reference
+
The array to hold the user names retrieved. - -
-

-


-

GroupSetInfo(server, group, level, hash, error)

-

-Sets the information for group according to level. - -

-
server - Scalar String
-

-The server on which to set the group information. - -

group - Scalar String
-

-The group whose information you wish to set. - -

level - Scalar Int
-

-The level of information you are supplying in hash. Level can be one of 0, 1 or 2. See GROUP INFO LEVELS. - -

hash - Hash Reference
+

-The hash containing the required key/value pairs for level. - -

error - Scalar String
-

-On failure, the error parameter will contain a value which specifies which field caused the -error. See GROUP FIELD ERRORS. - - -

-


-

GroupSetUsers(server, group, array)

-

-Sets the membership of group to contain only those users specified in array. This function will fail if any user names contained in the array are not -valid users on server. On successful completion -group will contain only the users specified in array. Use the functions GroupAddUser()/GroupDelUser() to add and delete individual users from a group. - +

GroupSetInfo(server, group, level, hash, error)

+

Sets the information for group according to level.

-
server - Scalar String
-

-The server on which to set the group membership. - -

group - Scalar String
-

-The group to set the membership of. - -

array - Array Reference
-

-The array containing the names of all users who will be members of group. - -

-

-


-

NET LOCAL GROUP FUNCTIONS

-

-The LocalGroup*() functions operate on local groups. If these functions are run on a PDC then -these functions operate on the domains local groups. - -

-Administrator or Account Operator group membership is required to +

server - Scalar String
+
+The server on which to set the group information. +

+
group - Scalar String
+
+The group whose information you wish to set. +

+
level - Scalar Int
+
+The level of information you are supplying in hash. Level can be +one of 0, 1 or 2. See GROUP INFO LEVELS. +

+
hash - Hash Reference
+
+The hash containing the required key/value pairs for level. +

+
error - Scalar String
+
+On failure, the error parameter will contain a value which specifies +which field caused the error. See GROUP FIELD ERRORS. +

+

+

GroupSetUsers(server, group, array)

+

Sets the membership of group to contain only those users specified +in array. This function will fail if any user names contained in the +array are not valid users on server. On successful completion +group will contain only the users specified in array. Use the +functions GroupAddUser()/GroupDelUser() to add and delete individual +users from a group.

+
+
server - Scalar String
+
+The server on which to set the group membership. +

+
group - Scalar String
+
+The group to set the membership of. +

+
array - Array Reference
+
+The array containing the names of all users who will be members of group. +

+

+


+

NET LOCAL GROUP FUNCTIONS

+

The LocalGroup*() functions operate on local groups. If these +functions are run on a PDC then these functions operate on the domains +local groups.

+

Administrator or Account Operator group membership is required to successfully execute most of these functions on a remote server or on a -computer that has local security enabled. - -

-The server field can be the empty string, in which case the function defaults to -running on the local computer. If you leave this field blank then you -should ensure that you are running the function on a PDC or BDC for your -current domain. Use the support function GetDCName() to find out what the domain controller is, should you not be running this -on the PDC. - -

-The following functions are available. - -

-


-

LocalGroupAdd(server, level, hash, error)

-

-Adds the specified group. The name of the group is contained in the name -key of hash. - -

-
server - Scalar String
-

-The server on which to add the group. - -

level - Scalar String
-

-The level of information contained in hash. This can be one of 0 or 1. See LOCAL GROUP INFO LEVELS. - -

hash - Hash Reference
-

-A hash containing the required key/value pairs for level. - -

error - Scalar Int
-

-Provides information on which field in hash wasn't properly specified. See LOCAL GROUP FIELD ERRORS for more information about what values this can take. - -

-

-


-

LocalGroupAddMember()

-

-This function is obselete in the underlying API and has therefore not been -implemented. Use LocalGroupAddMembers instead. - -

-


-

LocalGroupAddMembers(server, group, array)

-

-Adds the specified users (members) to the local group. Unlike the API -function NetLocalGroupAddMembers(), this function does not allow you to specify a level (internally it is -hardcoded to 3). This was done to simplify the implementation. To add a -'local' user, you need only specify the name. You can also specify users using the -DOMAIN\user syntax. - -

-
server - Scalar String
-

-The server on which to add the members to group. - -

group - Scalar String
-

-The group to add the members to. - -

array - Array Reference
-

-The array containing the members to add to group. - -

-

-


-

LocalGroupDel(server, group)

-

-Delete the specified local group. - -

-
server - Scalar String
-

-The server on which to delete the named group. - -

group -Scalar String
-

-The group to delete. - -

-

-


-

LocalGroupDelMember()

-

-This function is obselete in the underlying API and has therefore not been -implemented. Use LocalGroupDelMembers() instead. - -

-


-

LocalGroupDelMembers(server, group, array)

-

-Delete the specified users (members) of the local group. Unlike the API -function NetLocalGroupDelMembers(), this function does not allow you to specify a level (internally it is -hardcoded to 3). This was done to simplify the implementation. To delete a -'local' user, you need only specify the name. You can also specify users using the DOMAIN\user -syntax. - -

-
server - Scalar String
-

-The server on which to delete the members from group. - -

group - Scalar String
-

-The group to delete the members from. - -

array - Array Reference
-

-The array containing the members to delete from group. - -

-

-


-

LocalGroupEnum(server, array)

-

-Enumerates all the local groups on the server. Unlike the API call -NetLocalGroupEnum(), this function does not allow you to specify a level (internally it is -hardcoded to 0). In Perl it is trivial to implement the equivalent function -(should you need it). - +computer that has local security enabled.

+

The server field can be the empty string, in which case the function +defaults to running on the local computer. If you leave this field blank +then you should ensure that you are running the function on a PDC or BDC +for your current domain. Use the support function GetDCName() to find +out what the domain controller is, should you not be running this on the PDC.

+

The following functions are available.

+

+

LocalGroupAdd(server, level, hash, error)

+

Adds the specified group. The name of the group is contained in the name +key of hash.

+
+
server - Scalar String
+
+The server on which to add the group. +

+
level - Scalar String
+
+The level of information contained in hash. This can be one of 0 or 1. +See LOCAL GROUP INFO LEVELS. +

+
hash - Hash Reference
+
+A hash containing the required key/value pairs for level. +

+
error - Scalar Int
+
+Provides information on which field in hash wasn't properly specified. +See LOCAL GROUP FIELD ERRORS for more information about what values +this can take. +

+

+

LocalGroupAddMember()

+

This function is obselete in the underlying API and has therefore not +been implemented. Use LocalGroupAddMembers instead.

+

+

LocalGroupAddMembers(server, group, array)

+

Adds the specified users (members) to the local group. Unlike the API +function NetLocalGroupAddMembers(), this function does not allow you +to specify a level (internally it is hardcoded to 3). +This was done to simplify the implementation. To add a 'local' user, you +need only specify the name. You can also specify users using the +DOMAIN\user syntax.

+
+
server - Scalar String
+
+The server on which to add the members to group. +

+
group - Scalar String
+
+The group to add the members to. +

+
array - Array Reference
+
+The array containing the members to add to group. +

+

+

LocalGroupDel(server, group)

+

Delete the specified local group.

+
+
server - Scalar String
+
+The server on which to delete the named group. +

+
group -Scalar String
+
+The group to delete. +

+

+

LocalGroupDelMember()

+

This function is obselete in the underlying API and has therefore not +been implemented. Use LocalGroupDelMembers() instead.

+

+

LocalGroupDelMembers(server, group, array)

+

Delete the specified users (members) of the local group. Unlike the API +function NetLocalGroupDelMembers(), this function does not allow you +to specify a level (internally it is hardcoded to 3). This was done to +simplify the implementation. To delete a 'local' user, you need only +specify the name. You can also specify users using the DOMAIN\user +syntax.

+
+
server - Scalar String
+
+The server on which to delete the members from group. +

+
group - Scalar String
+
+The group to delete the members from. +

+
array - Array Reference
+
+The array containing the members to delete from group. +

+

+

LocalGroupEnum(server, array)

+

Enumerates all the local groups on the server. Unlike the API call +NetLocalGroupEnum(), this function does not allow you to specify a +level (internally it is hardcoded to 0). In Perl it is trivial to +implement the equivalent function (should you need it).

-
server - Scalar String
-

+

server - Scalar String
+
The server on which to enumerate the (local) groups. - -
array - Array Reference
-

-The array to hold the group names. - -

-

-


-

LocalGroupGetInfo(server, group, level, hash)

-

-Retrieves level information for group. - -

-
server - Scalar String
-

-The server from which to get the group information. - -

group - Scalar String
-

-The group whose information you wish to obtain. - -

level - Scalar Int
-

-The level of information you wish to retrieve. This can be 0 or 1. See LOCAL GROUP INFO LEVELS. - -

hash - Hash Reference
-

+

+
array - Array Reference
+
+The array to hold the group names. +

+

+

LocalGroupGetInfo(server, group, level, hash)

+

Retrieves level information for group.

+
+
server - Scalar String
+
+The server from which to get the group information. +

+
group - Scalar String
+
+The group whose information you wish to obtain. +

+
level - Scalar Int
+
+The level of information you wish to retrieve. This can be 0 or 1. +See LOCAL GROUP INFO LEVELS. +

+
hash - Hash Reference
+
The hash that will contain the information. - -
-

-


-

LocalGroupGetMembers(server, group, hash)

-

-Retrieves the users belonging to group. Unlike the API call -NetLocalGroupGetUsers(), this function does not allow you to specify a level (internally it is -hardcoded to 0). In Perl it is trivial to implement the equivalent function -(should you need it). - -

-
server - Scalar String
+

-The server from which to retrieve the group information. - -

group - Scalar String
-

-The group whose users you wish to obtain. - -

array - Array Reference
-

+

LocalGroupGetMembers(server, group, hash)

+

Retrieves the users belonging to group. Unlike the API call +NetLocalGroupGetUsers(), this function does not allow you to specify +a level (internally it is hardcoded to 0). In Perl it is trivial to +implement the equivalent function (should you need it).

+
+
server - Scalar String
+
+The server from which to retrieve the group information. +

+
group - Scalar String
+
+The group whose users you wish to obtain. +

+
array - Array Reference
+
The array to hold the user names retrieved. - -
-

-


-

LocalGroupSetInfo(server, level, hash, error)

-

-Sets the information for group according to level. - -

-
server - Scalar String
-

-The server on which to set the group information. - -

group - Scalar String
-

-The group whose information you wish to set. - -

level - Scalar Int
-

-The level of information you are supplying in hash. Level can be one of 0 or 1. See LOCAL GROUP INFO LEVELS. - -

hash - Hash Reference
-

-The hash containing the required key/value pairs for level. - -

error - Scalar String
-

-On failure, the error parameter will contain a value which specifies which field caused the -error. See LOCAL GROUP FIELD ERRORS. - -

-

-


-

LocalGroupSetMembers()

-

-This function has not been implemented at present. - -

-


-

NET GET FUNCTIONS

-

-


-

GetDCName(server, domain, domain-controller)

+

-Gets the domain-controllder name for server and domain. - +

LocalGroupSetInfo(server, level, hash, error)

+

Sets the information for group according to level.

-
server - Scalar String
-

-The server whose domain controller you wish to locate. - -

domain - Scalar String
-

-The domain that server is a member of whose domain-controller you wish the locate. - -

domain-controller - Scalar String (output)
-

-The name of the domain-controller for the requested domain. - -

-

-Note: This module does not implement the NetGetAnyDCName()API function as this is obsolete. - -

-


-

USER INFO LEVELS

-

-Most of the User*() functions take a level parameter. This level -specifies how much detail the corresponding hash should contain (or in the case of a UserGet*() function, will contain after the call). The following level descriptions provide information on what fields should be present for a -given level. See USER INFO FIELDS for a description of the fields. - +

server - Scalar String
+
+The server on which to set the group information. +

+
group - Scalar String
+
+The group whose information you wish to set. +

+
level - Scalar Int
+
+The level of information you are supplying in hash. +Level can be one of 0 or 1. See LOCAL GROUP INFO LEVELS. +

+
hash - Hash Reference
+
+The hash containing the required key/value pairs for level. +

+
error - Scalar String
+
+On failure, the error parameter will contain a value which specifies +which field caused the error. See LOCAL GROUP FIELD ERRORS. +

+

+

LocalGroupSetMembers()

+

This function has not been implemented at present.

+

+


+

NET GET FUNCTIONS

+

+

GetDCName(server, domain, domain-controller)

+

Gets the domain-controller name for server and domain.

+
+
server - Scalar String
+
+The server whose domain controller you wish to locate. +

+
domain - Scalar String
+
+The domain that server is a member of whose domain-controller +you wish the locate. +

+
domain-controller - Scalar String (output)
+
+The name of the domain-controller for the requested domain. +

+

Note: This module does not implement the NetGetAnyDCName()API function +as this is obsolete.

+

+


+

USER INFO LEVELS

+

Most of the User*() functions take a level parameter. This level +specifies how much detail the corresponding hash should contain (or in +the case of a UserGet*() function, will contain after the call). The +following level descriptions provide information on what fields should +be present for a given level. See USER INFO FIELDS for a description of +the fields.

-
Level 0
-

+

Level 0
+
name - -
Level 1
-

+

+
Level 1
+
name, password, passwordAge, priv, homeDir, comment, flags, scriptPath - -
Level 2
-

+

+
Level 2
+
name, password, passwordAge, priv, homeDir, comment, flags, scriptPath, authFlags, fullName, usrComment, parms, workstations, lastLogon, lastLogoff, acctExpires, maxStorage, unitsPerWeek, logonHours, badPwCount, numLogons, logonServer, countryCode, codePage - -
Level 3
-

+

+
Level 3
+
name, password, passwordAge, priv, homeDir, comment, flags, scriptPath, -authFlags, fullName, usrComment, parms, workstations, lastLogon, -lastLogoff, acctExpires, maxStorage, unitsPerWeek, logonHours, badPwCount, -numLogons, logonServer, countryCode, codePage, userId, primaryGroupId, -profile, homeDirDrive, passwordExpired - -
Level 10
-

+authFlags, fullName, usrComment, parms, workstations, lastLogon, lastLogoff, +acctExpires, maxStorage, unitsPerWeek, logonHours, badPwCount, numLogons, +logonServer, countryCode, codePage, userId, primaryGroupId, profile, +homeDirDrive, passwordExpired +

+
Level 10
+
name, comment, usrComment, fullName - -
Level 11
-

+

+
Level 11
+
name, comment, usrComment, fullName, priv, authFlags, passwordAge, homeDir, parms, lastLogon, lastLogoff, badPwCount, numLogons, logonServer, countryCode, workstations, maxStorage, unitsPerWeek, logonHours, codePage - -
Level 20
-

+

+
Level 20
+
name, fullName, comment, flags, userId - -
Level 21
-

+

+
Level 21
+
Not available in this implementation - - - -
Level 22
-

+

+
Level 22
+
Not available in this implementation - - - -
Level 1003
-

+

+
Level 1003
+
password - -
Level 1005
-

+

+
Level 1005
+
priv - -
Level 1006
-

+

+
Level 1006
+
homeDir - -
Level 1007
-

+

+
Level 1007
+
comment - -
Level 1008
-

+

+
Level 1008
+
flags - -
Level 1009
-

+

+
Level 1009
+
scriptPath - -
Level 1010
-

+

+
Level 1010
+
authFlags - -
Level 1011
-

+

+
Level 1011
+
fullName - -
Level 1012
-

+

+
Level 1012
+
usrComment - -
Level 1013
-

+

+
Level 1013
+
parms - -
Level 1014
-

+

+
Level 1014
+
workstations - -
Level 1017
-

+

+
Level 1017
+
acctExpires - -
Level 1018
-

+

+
Level 1018
+
maxStorage - -
Level 1020
-

+

+
Level 1020
+
unitsPerWeek, logonHours - -
Level 1023
-

+

+
Level 1023
+
logonServer - -
Level 1024
-

+

+
Level 1024
+
countryCode - -
Level 1025
-

+

+
Level 1025
+
codePage - -
Level 1051
-

+

+
Level 1051
+
primaryGroupId - -
Level 1052
-

+

+
Level 1052
+
profile - -
Level 1053
-

+

+
Level 1053
+
homeDirDrive - -
+


-

USER INFO FIELDS

-

-The following is an alphabetical listing of each possible field, together -with the data type that the field is expected to contain. - +

USER INFO FIELDS

+

The following is an alphabetical listing of each possible field, together +with the data type that the field is expected to contain.

-
acctExpires - Scalar Int (UTC)
-

+

acctExpires - Scalar Int (UTC)
+
The time (as the number of seconds since 00:00:00, 1st January 1970) when the account expires. A -1 in this field specifies that the account never expires. - -
authFlags - Scalar Int (See USER_AUTH_FLAGS).
-

+

+
authFlags - Scalar Int (See USER_AUTH_FLAGS).
+
The level of authority that this use has. The value this can take depends on the users group membership - this value is therefore read only and -cannot be set using UserAdd() or UserSetInfo(). Its value can be one of: - -
-

-

        User belongs to group           Flag value
+cannot be set using UserAdd() or UserSetInfo(). Its value can be one
+of:
+

+
+        User belongs to group           Flag value
         ---------------------           ----------
         Print Operators                 Win32API::Net::AF_OP_PRINT()
         Server Operators                Win32API::Net::AF_OP_SERVER()
-        Account Operators               Win32API::Net::AF_OP_ACCOUNTS()
-
+ Account Operators Win32API::Net::AF_OP_ACCOUNTS()
-
badPwCount - Scalar Int
-

+

badPwCount - Scalar Int
+
The number of times that the user has failed to logon by specifying an incorrect password. - -
codePage - Scalar Int
-

+

+
codePage - Scalar Int
+
The code page that this user uses. - -
comment - Scalar String
-

+

+
comment - Scalar String
+
The comment associated with this user account. This can be any string (apparently of any length). - -
countryCode - Scalar Int
-

+

+
countryCode - Scalar Int
+
The country code that this user uses. - -
flags - Scalar Int (Bitwise OR of USER_FLAGS)
-

-The flags for this user. See USER FLAGS. - -

fullName - Scalar String
-

+

+
flags - Scalar Int (Bitwise OR of USER_FLAGS)
+
+The flags for this user. See USER FLAGS. +

+
fullName - Scalar String
+
The users' full name. - -
homeDir - Scalar String
-

+

+
homeDir - Scalar String
+
The home directory of the user. This can be either a UNC path or an absolute path (drive letter + path). Can be the empty string (``''). - -
homeDirDrive - Scalar String
-

+

+
homeDirDrive - Scalar String
+
The home directory drive that the users home directory is mapped to (assuming that the specified home directory is a UNC path). - -
lastLogon - Scalar Int (UTC)
-

-The time (as the number of seconds since 00:00:00, 1st January 1970) that -the user last logged on. - -

lastLogoff - Scalar Int (UTC)
-

-The time (as the number of seconds since 00:00:00, 1st January 1970) that -the user last logged off . - -

logonHours - Reference to Array of Integers (length 21 elements)
-

-The times at which the user can logon. This should be an integer array with -21 elements. Each element represents an 8 hour period and each bit -represents represents an hour. Only the lower byte of each integer is used. -If this is left undefined then no restrictions are placed on the account. - -

logonServer - Scalar String
-

-The logon server for this user. Under Windows NT, this value cannot be set -and will always have the value '\\*' when queried. - -

maxStorage - Scalar Int
-

-The current release of Windows NT does not implement disk quotas so it is -believed that the value of this key is ignored. - -

name - Scalar String
-

-The user name that this request applies to. Most of the functions take the -user name as a separate argument. In general, the user name provided should -be the same as that in the one provided in the hash. - -

numLogons - Scalar Int
-

-The number of times that the named user has successfully logged on to this -machine/domain. - -

parms - Scalar String
-

-The value of this key can be used by applications. There are none known to -to author that use it, although it could be used to hold adminitrative +

+
lastLogon - Scalar Int (UTC)
+
+The time (as the number of seconds since 00:00:00, 1st January 1970) +that the user last logged on. +

+
lastLogoff - Scalar Int (UTC)
+
+The time (as the number of seconds since 00:00:00, 1st January 1970) +that the user last logged off . +

+
logonHours - Reference to Array of Integers (length 21 elements)
+
+The times at which the user can logon. This should be an integer array +with 21 elements. Each element represents an 8 hour period and each bit +represents represents an hour. Only the lower byte of each integer is +used. If this is left undefined then no restrictions are placed on the +account. +

+
logonServer - Scalar String
+
+The logon server for this user. Under Windows NT, this value cannot be +set and will always have the value '\\*' when queried. +

+
maxStorage - Scalar Int
+
+The current release of Windows NT does not implement disk quotas so +it is believed that the value of this key is ignored. +

+
name - Scalar String
+
+The user name that this request applies to. Most of the functions take +the user name as a separate argument. In general, the user name provided +should be the same as that in the one provided in the hash. +

+
numLogons - Scalar Int
+
+The number of times that the named user has successfully logged on to +this machine/domain. +

+
parms - Scalar String
+
+The value of this key can be used by applications. There are none known +to to author that use it, although it could be used to hold adminitrative information. - -
password - Scalar String
-

+

+
password - Scalar String
+
The password to be set. The password is never returned in a UserGet() operation. - -
passwordAge - Scalar Int (UTC)
-

+

+
passwordAge - Scalar Int (UTC)
+
The current age of the password (stored as the number of seconds since 00:00:00, 1st January 1970). - -
passwordExpired - Scalar Int
-

+

+
passwordExpired - Scalar Int
+
The value of this key is used in two different ways. When queried via -UserGetInfo() the return value is 0 is the password has not expired and 1 if it has. When -setting the value via UserAdd() or -UserSetInfo() a value of 0 indicates that the users' password has not expired whereas a -value of 1 will force the user to change their password at the next logon. - -
primaryGroupId - Scalar Int
-

+UserGetInfo() the return value is 0 is the password has not expired +and 1 if it has. When setting the value via UserAdd() or +UserSetInfo() a value of 0 indicates that the users' password has +not expired whereas a value of 1 will force the user to change their +password at the next logon. +

+
primaryGroupId - Scalar Int
+
The id of the primary group that this user belongs to. When creating accounts with UserAdd() you should use a value of 0x201. - -
priv - Scalar Int (Bitwise OR of USER_PRIVILEGE_FLAGS)
-

+

+
priv - Scalar Int (Bitwise OR of USER_PRIVILEGE_FLAGS)
+
The privilege level that this user has. This is never returned from a -UserGet() call. See USER PRIVILEGE FLAGS. - -
profile - Scalar String
-

-The profile that is associated with the named user. This can be UNC path, a -local path or undefined. - -

scriptPath - Scalar String
-

+UserGet() call. See USER PRIVILEGE FLAGS. +

+
profile - Scalar String
+
+The profile that is associated with the named user. This can be UNC path, +a local path or undefined. +

+
scriptPath - Scalar String
+
The path to the logon script for this user. This should be specified as a relative path and will cause the logon script to be run from (relative location) in the logon servers export directory. - -
unitsPerWeek - Scalar Int
-

+

+
unitsPerWeek - Scalar Int
+
The value of this key represents the granularity of the logonHours array. Its use is beyond the scope of this package. - -
usrComment - Scalar String
-

+

+
usrComment - Scalar String
+
The user comment field (contrasted with the comment field ;-). - -
workstations - Scalar String
-

-A comma-separated string containing upto 8 workstation that the named user -can login to. Setting a value for this key will then allow the named user -to login to only those computers named. - -

userId - Scalar Int
-

-The user id associated with this user This value is generated by the system -and cannot be set or changed using the UserAdd() or +

+
workstations - Scalar String
+
+A comma-separated string containing upto 8 workstation that the named +user can login to. Setting a value for this key will then allow the +named user to login to only those computers named. +

+
userId - Scalar Int
+
+The user id associated with this user This value is generated by the +system and cannot be set or changed using the UserAdd() or UserSetInfo() calls. - -
+


-

USER FLAGS

-

-The following is an alphabetical listing of the user flags. The flags key (see USER INFO FIELDS) should be the bitwise OR of one or more of these values. - +

USER FLAGS

+

The following is an alphabetical listing of the user flags. +The flags key (see USER INFO FIELDS) should be the bitwise OR of one +or more of these values.

-
UF_ACCOUNTDISABLE()
-

+

UF_ACCOUNTDISABLE()
+
This account has been disabled. - -
UF_DONT_EXPIRE_PASSWD()
-

+

+
UF_DONT_EXPIRE_PASSWD()
+
Never expire the password on this account. - -
UF_HOMEDIR_REQUIRED()
-

+

+
UF_HOMEDIR_REQUIRED()
+
A home directory must be specified (ignored for NT). - -
UF_INTERDOMAIN_TRUST_ACCOUNT()
-

+

+
UF_INTERDOMAIN_TRUST_ACCOUNT()
+
The account represents a interdomain trust account. - -
UF_LOCKOUT()
-

-Lock out this account (or this account has been locked out due to security -policy - i.e. badLogonCount is greater than your policy allows). This value -can be cleared but not set by a UserSetInfo() call. - -

UF_NORMAL_ACCOUNT()
-

+

+
UF_LOCKOUT()
+
+Lock out this account (or this account has been locked out due to +security policy - i.e. badLogonCount is greater than your policy allows). +This value can be cleared but not set by a UserSetInfo() call. +

+
UF_NORMAL_ACCOUNT()
+
The account is a normal user account. - -
UF_PASSWD_CANT_CHANGE()
-

+

+
UF_PASSWD_CANT_CHANGE()
+
The password for this account cannot be changed (execpt by an Administrator using one of the above calls). - -
UF_PASSWD_NOTREQD()
-

+

+
UF_PASSWD_NOTREQD()
+
A password is not required for this account. - -
UF_SCRIPT()
-

+

+
UF_SCRIPT()
+
This <strong>must be set when creating account on Windows NT. - -
UF_SERVER_TRUST_ACCOUNT()
-

-The account represents a Windows NT Backup Domain Controller account in the -domain. - -

UF_TEMP_DUPLICATE_ACCOUNT()
-

-To quote the Microsoft Documentation <em>&quot;This is an account -for users whose primary account is in another domain. This account provides +

+
UF_SERVER_TRUST_ACCOUNT()
+
+The account represents a Windows NT Backup Domain Controller account in +the domain. +

+
UF_TEMP_DUPLICATE_ACCOUNT()
+
+To quote the Microsoft Documentation <em>&quot;This is an account for +users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. The User Manager refers to this account type as a local user account. - -
UF_WORKSTATION_TRUST_ACCOUNT()
-

+

+
UF_WORKSTATION_TRUST_ACCOUNT()
+
The account represents a computer account for a workstation or server in the domain. - -
-

-Please note that these are implemented as functions and are therefore +

+

Please note that these are implemented as functions and are therefore called in the same way as other functions. You should typically use them -like: - -

-

        $ufScript = Win32API::Net::UF_SCRIPT();
-
+like:

+
+        $ufScript = Win32API::Net::UF_SCRIPT();


-

USER PRIVILEGE FLAGS

-

-These following values are used in the priv key. This field is never initialised on a UserGet*() call and once set cannot be changed in a -UserSetInfo() call. - +

USER PRIVILEGE FLAGS

+

These following values are used in the priv key. This field is never +initialised on a UserGet*() call and once set cannot be changed in a +UserSetInfo() call.

-
USER_PRIV_ADMIN()
-

+

USER_PRIV_ADMIN()
+
Account is an an administrative account. - -
USER_PRIV_GUEST()
-

+

+
USER_PRIV_GUEST()
+
Account is a guest account. - -
USER_PRIV_USER()
-

+

+
USER_PRIV_USER()
+
Account is a user account. - -
-

-Please note that these are implemented as functions and are therefore +

+

Please note that these are implemented as functions and are therefore called in the same way as other functions. You should typically use them -like: - -

-

        $userPrivUser = Win32API::Net::USER_PRIV_USER();
-
+like:

+
+        $userPrivUser = Win32API::Net::USER_PRIV_USER();


-

USER ENUM FILTER

-

-These flags are used in the UserEnum() function to specify which accounts to retrieve. It should be a bitwise OR -of some (or all) of the following. - +

USER ENUM FILTER

+

These flags are used in the UserEnum() function to specify which +accounts to retrieve. It should be a bitwise OR of some (or all) of +the following.

-
FILTER_TEMP_DUPLICATE_ACCOUNT()
-

+

FILTER_TEMP_DUPLICATE_ACCOUNT()
+
Show temporary duplicate account (one presumes). - -
FILTER_NORMAL_ACCOUNT()
-

+

+
FILTER_NORMAL_ACCOUNT()
+
Show normal user account. - -
FILTER_INTERDOMAIN_TRUST_ACCOUNT()
-

+

+
FILTER_INTERDOMAIN_TRUST_ACCOUNT()
+
Show interdomain trust accounts. - -
FILTER_WORKSTATION_TRUST_ACCOUNT()
-

+

+
FILTER_WORKSTATION_TRUST_ACCOUNT()
+
Show workstation trust accounts. - -
FILTER_SERVER_TRUST_ACCOUNT()
-

+

+
FILTER_SERVER_TRUST_ACCOUNT()
+
Show server trust accounts. - -
-

-Please note that these are implemented as functions and are therefore +

+

Please note that these are implemented as functions and are therefore called in the same way as other functions. You should typically use them -like: - -

-

        $filterNormalAccounts = Win32API::Net::FILTER_NORMAL_ACCOUNT();
-
-

-


-

USER FIELD ERRORS

-

-For the User*() functions that take an error parameter this variable will, on failure, contain one of the following -constants. Note that the function may fail because more than one key/value -was missing from the input hash. You will only find out about the first one -that was incorrectly specified. This is only really useful in debugging. - -

-
USER_ACCT_EXPIRES_PARMNUM()
-

-acctExpires field was absent or not correctly specified. - -

USER_AUTH_FLAGS_PARMNUM()
-

-authFlags field was absent or not correctly specified. - -

USER_BAD_PW_COUNT_PARMNUM()
-

+like:

+
+        $filterNormalAccounts = Win32API::Net::FILTER_NORMAL_ACCOUNT();
+

+


+

USER FIELD ERRORS

+

For the User*() functions that take an error parameter this variable +will, on failure, contain one of the following constants. Note that the +function may fail because more than one key/value was missing from the +input hash. You will only find out about the first one that was incorrectly +specified. This is only really useful in debugging.

+
+
USER_ACCT_EXPIRES_PARMNUM()
+
+acctExpires field was absent or not correctly specified. +

+
USER_AUTH_FLAGS_PARMNUM()
+
+authFlags field was absent or not correctly specified. +

+
USER_BAD_PW_COUNT_PARMNUM()
+
badPasswordCount field was absent or not correctly specified. - -
USER_CODE_PAGE_PARMNUM()
-

-codePage field was absent or not correctly specified. - -

USER_COMMENT_PARMNUM()
-

-comment field was absent or not correctly specified. - -

USER_COUNTRY_CODE_PARMNUM()
-

-countryCode field was absent or not correctly specified. - -

USER_FLAGS_PARMNUM()
-

-flags field was absent or not correctly specified. - -

USER_FULL_NAME_PARMNUM()
-

-fullName field was absent or not correctly specified. - -

USER_HOME_DIR_DRIVE_PARMNUM()
-

-homeDirDrive field was absent or not correctly specified. - -

USER_HOME_DIR_PARMNUM()
-

-homeDir field was absent or not correctly specified. - -

USER_LAST_LOGOFF_PARMNUM()
-

-lastLogoff field was absent or not correctly specified. - -

USER_LAST_LOGON_PARMNUM()
-

-lastLogon field was absent or not correctly specified. - -

USER_LOGON_HOURS_PARMNUM()
-

-logonHours field was absent or not correctly specified. - -

USER_LOGON_SERVER_PARMNUM()
-

-logonServer field was absent or not correctly specified. - -

USER_MAX_STORAGE_PARMNUM()
-

-maxStorage field was absent or not correctly specified. - -

USER_NAME_PARMNUM()
-

-name field was absent or not correctly specified. - -

USER_NUM_LOGONS_PARMNUM()
-

-numLogons field was absent or not correctly specified. - -

USER_PARMS_PARMNUM()
-

-parms field was absent or not correctly specified. - -

USER_PASSWORD_AGE_PARMNUM()
-

-passwordAge field was absent or not correctly specified. - -

USER_PASSWORD_PARMNUM()
-

-password field was absent or not correctly specified. - -

USER_PRIMARY_GROUP_PARMNUM()
-

+

+
USER_CODE_PAGE_PARMNUM()
+
+codePage field was absent or not correctly specified. +

+
USER_COMMENT_PARMNUM()
+
+comment field was absent or not correctly specified. +

+
USER_COUNTRY_CODE_PARMNUM()
+
+countryCode field was absent or not correctly specified. +

+
USER_FLAGS_PARMNUM()
+
+flags field was absent or not correctly specified. +

+
USER_FULL_NAME_PARMNUM()
+
+fullName field was absent or not correctly specified. +

+
USER_HOME_DIR_DRIVE_PARMNUM()
+
+homeDirDrive field was absent or not correctly specified. +

+
USER_HOME_DIR_PARMNUM()
+
+homeDir field was absent or not correctly specified. +

+
USER_LAST_LOGOFF_PARMNUM()
+
+lastLogoff field was absent or not correctly specified. +

+
USER_LAST_LOGON_PARMNUM()
+
+lastLogon field was absent or not correctly specified. +

+
USER_LOGON_HOURS_PARMNUM()
+
+logonHours field was absent or not correctly specified. +

+
USER_LOGON_SERVER_PARMNUM()
+
+logonServer field was absent or not correctly specified. +

+
USER_MAX_STORAGE_PARMNUM()
+
+maxStorage field was absent or not correctly specified. +

+
USER_NAME_PARMNUM()
+
+name field was absent or not correctly specified. +

+
USER_NUM_LOGONS_PARMNUM()
+
+numLogons field was absent or not correctly specified. +

+
USER_PARMS_PARMNUM()
+
+parms field was absent or not correctly specified. +

+
USER_PASSWORD_AGE_PARMNUM()
+
+passwordAge field was absent or not correctly specified. +

+
USER_PASSWORD_PARMNUM()
+
+password field was absent or not correctly specified. +

+
USER_PRIMARY_GROUP_PARMNUM()
+
primaryGroup field was absent or not correctly specified. - -
USER_PRIV_PARMNUM()
-

-priv field was absent or not correctly specified. - -

USER_PROFILE_PARMNUM()
-

-profile field was absent or not correctly specified. - -

USER_SCRIPT_PATH_PARMNUM()
-

-scriptPath field was absent or not correctly specified. - -

USER_UNITS_PER_WEEK_PARMNUM()
-

+

+
USER_PRIV_PARMNUM()
+
+priv field was absent or not correctly specified. +

+
USER_PROFILE_PARMNUM()
+
+profile field was absent or not correctly specified. +

+
USER_SCRIPT_PATH_PARMNUM()
+
+scriptPath field was absent or not correctly specified. +

+
USER_UNITS_PER_WEEK_PARMNUM()
+
unitPerWeek field was absent or not correctly specified. - -
USER_USR_COMMENT_PARMNUM()
-

-usrComment field was absent or not correctly specified. - -

USER_WORKSTATIONS_PARMNUM()
-

-workstations field was absent or not correctly specified. - -

-

-


-

GROUP INFO LEVELS

-

-Some of the Group*() functions take a level parameter. This level -specifies how much detail the corresponding hash should contain (or in the case of a GroupGetInfo() function, will contain after the call). The following level descriptions provide information on what fields should be present for a -given level. See GROUP INFO FIELDS -for a description of the fields. - +

+
USER_USR_COMMENT_PARMNUM()
+
+usrComment field was absent or not correctly specified. +

+
USER_WORKSTATIONS_PARMNUM()
+
+workstations field was absent or not correctly specified. +

+

+


+

GROUP INFO LEVELS

+

Some of the Group*() functions take a level parameter. This level +specifies how much detail the corresponding hash should contain (or in +the case of a GroupGetInfo() function, will contain after the call). +The following level descriptions provide information on what fields +should be present for a given level. See GROUP INFO FIELDS +for a description of the fields.

-
Level 0
-

+

Level 0
+
name. - -
Level 1
-

+

+
Level 1
+
name, comment. - -
Level 2
-

+

+
Level 2
+
name, comment, groupId, attributes. - -
Level 1002
-

+

+
Level 1002
+
comment. - -
Level 1005
-

+

+
Level 1005
+
attributes. - -
+


-

GROUP INFO FIELDS

+

GROUP INFO FIELDS

-
attributes - Scalar Int
-

+

attributes - Scalar Int
+
The attributes of the group. These are no longer settable in Windows NT 4.0 and they are not currently supported in this package either. - -
comment - Scalar String
-

-The comment that applies to this group. This is the only value that can be set via a -GroupSetInfo call. - -

groupId - Scalar Int
-

+

+
comment - Scalar String
+
+The comment that applies to this group. This is the only value that +can be set via a GroupSetInfo call. +

+
groupId - Scalar Int
+
The groups Id. - -
name - Scalar String
-

+

+
name - Scalar String
+
The groups name. - -
+


-

GROUP FIELD ERRORS

-

-For the Group*() functions that take an error parameter this variable will, on failure, contain one of the following -constants. Note that the function may fail because more than one key/value -was missing from the input hash. You will only find out about the first one +

GROUP FIELD ERRORS

+

For the Group*() functions that take an error parameter +this variable will, on failure, contain one of the following constants. +Note that the function may fail because more than one key/value was +missing from the input hash. You will only find out about the first one that was incorrectly specified. This is only really useful for debugging -purposes. - +purposes.

-
GROUP_ATTRIBUTES_PARMNUM()
-

-attributes field was absent or not correctly specified. - -

GROUP_COMMENT_PARMNUM()
-

-comment field was absent or not correctly specified. - -

GROUP_NAME_PARMNUM()
-

-name field was absent or not correctly specified. - -

-

-


-

GROUP USERS INFO LEVELS

-

-The GroupGetUsers() function can take a level of 0 or 1. These will return the following: - +

GROUP_ATTRIBUTES_PARMNUM()
+
+attributes field was absent or not correctly specified. +

+
GROUP_COMMENT_PARMNUM()
+
+comment field was absent or not correctly specified. +

+
GROUP_NAME_PARMNUM()
+
+name field was absent or not correctly specified. +

+

+


+

GROUP USERS INFO LEVELS

+

The GroupGetUsers() function can take a level of 0 or 1. These will +return the following:

-
Level 0
-

+

Level 0
+
name. - -
Level 1
-

+

+
Level 1
+
name, attributes. - -
+


-

GROUP USERS INFO FIELDS

+

GROUP USERS INFO FIELDS

-
name - Scalar String
-

+

name - Scalar String
+
The user's name. - -
attributes - Scalar Int
-

-The attributes of the group. These are no longer settable in Windows NT 4.0 -and they are not currently supported in this package either. - -

+

+
attributes - Scalar Int
+
+The attributes of the group. These are no longer settable in Windows NT +4.0 and they are not currently supported in this package either. +


-

LOCAL GROUP INFO LEVELS

+

LOCAL GROUP INFO LEVELS

-
Level 0
-

+

Level 0
+
name - -
Level 1
-

+

+
Level 1
+
name, comment - -
Level 1002
-

+

+
Level 1002
+
comment - -
+


-

LOCAL GROUP INFO FIELDS

+

LOCAL GROUP INFO FIELDS

-
name - Scalar String
-

+

name - Scalar String
+
The groups name - -
comment - Scalar String
-

+

+
comment - Scalar String
+
The groups 'comment' - -
-

-


-

LOCAL GROUP FIELD ERRORS

-

-For the LocalGroup*() functions that take an error parameter this variable will, on failure, contain one of the following -constants. Note that the function may fail because more than one key/value -was missing or incorrectly specified in the input hash. You will only find -out about the first one that was incorrectly specified. This is only really -useful for debugging purposes. - -

-
LOCALGROUP_NAME_PARMNUM()
-

-The name field was absent or not correctly specified. - -

LOCALGROUP_COMMENT_PARMNUM()
-

-The comment field wasabsent or not correctly specified. - -

+


-

EXAMPLES

-

-The following example shows how you can create a function in Perl that has -the same functionality as the NetUserEnum() API call. The Perl version doesn't have the level parameter so you must -first use the -UserEnum() function to retrieve all the account names and then iterate through the -returned array issuing UserGetInfo() calls. - -

-

    sub userEnumAtLevel {
+

LOCAL GROUP FIELD ERRORS

+

For the LocalGroup*() functions that take an error parameter this +variable will, on failure, contain one of the following constants. Note +that the function may fail because more than one key/value was missing +or incorrectly specified in the input hash. You will only find out about +the first one that was incorrectly specified. This is only really useful +for debugging purposes.

+
+
LOCALGROUP_NAME_PARMNUM()
+
+The name field was absent or not correctly specified. +

+
LOCALGROUP_COMMENT_PARMNUM()
+
+The comment field wasabsent or not correctly specified. +

+

+


+

EXAMPLES

+

The following example shows how you can create a function in Perl that +has the same functionality as the NetUserEnum() API call. The Perl +version doesn't have the level parameter so you must first use the +UserEnum() function to retrieve all the account names and then iterate +through the returned array issuing UserGetInfo() calls.

+
+    sub userEnumAtLevel {
        my($server, $level, $filter) = @_;
        my(@array);
        Win32API::Net::UserEnum($server, \@array, $filter);
@@ -1757,35 +1566,25 @@
           print "This could access all level $level settings for $user - eg fullName $hash{fullName}\n";
        }
     }
-    userEnumAtLevel("", 2, 0);
-
+ userEnumAtLevel("", 2, 0);


-

AUTHOR

-

-Bret Giddings, <bret@essex.ac.uk> - +

AUTHOR

+

Bret Giddings, <bret@essex.ac.uk>


-

SEE ALSO

-

-perl(1) - - - +

SEE ALSO

+

perl(1)


-

ACKNOWEDGEMENTS

-

-This work was built upon work done by HiP Communications along with -modifications to HiPs code by <michael@ecel.uwa.edu.au> and -<rothd@roth.net> In addition, I -would like to thank Jenny Emby at GEC Marconi, U.K. for proof reading this -manual page and making many suggestions that have led to its current -layout. Last but not least I would like to thank Larry Wall and all the -other Perl contributors for making this truly wonderful language. +

ACKNOWEDGEMENTS

+

This work was built upon work done by HiP Communications along with +modifications to HiPs code by <michael@ecel.uwa.edu.au> and <rothd@roth.net>. +In addition, I would like to thank Jenny Emby at GEC Marconi, U.K. for +proof reading this manual page and making many suggestions that have led +to its current layout. Last but not least I would like to thank Larry Wall +and all the other Perl contributors for making this truly wonderful +language.

diff -urN libwin32-0.171/APINet/Net.pm libwin32-0.172/APINet/Net.pm --- libwin32-0.171/APINet/Net.pm Mon May 14 00:12:25 2001 +++ libwin32-0.172/APINet/Net.pm Mon May 14 00:14:08 2001 @@ -64,7 +64,7 @@ } $EXPORT_TAGS{ALL}= \@EXPORT_OK; -$VERSION = '0.081'; +$VERSION = '0.09'; sub AUTOLOAD { my $constname; @@ -219,7 +219,7 @@ L for more information on what these represent. -=head1 Exports +=head1 EXPORTS By default, Win32API::Net exports no symbols into the callers namespace. The following tags can be used to selectively import symbols into the @@ -992,7 +992,7 @@ =head2 GetDCName(server, domain, domain-controller) -Gets the C name for C and C. +Gets the C name for C and C. =over 8 @@ -1747,7 +1747,6 @@ The groups 'comment' =back - =head1 LOCAL GROUP FIELD ERRORS diff -urN libwin32-0.171/APINet/Net.xs libwin32-0.172/APINet/Net.xs --- libwin32-0.171/APINet/Net.xs Mon May 14 00:12:25 2001 +++ libwin32-0.172/APINet/Net.xs Mon May 14 00:14:08 2001 @@ -926,7 +926,7 @@ sv = newSViv((BYTE)(((CAST)uiX)->field)[i++]); \ av_push(av, sv); \ } \ - hv_store((HV*)hv, name, strlen(name), newRV_inc((SV*)av), 0); \ + hv_store((HV*)hv, name, strlen(name), newRV_noinc((SV*)av), 0); \ } STMT_END void diff -urN libwin32-0.171/APINet/t/test.t libwin32-0.172/APINet/t/test.t --- libwin32-0.171/APINet/t/test.t Mon May 14 00:12:25 2001 +++ libwin32-0.172/APINet/t/test.t Mon May 14 00:14:08 2001 @@ -49,7 +49,7 @@ @testLogonHours=( 255 ) x 21; %testUserInfo3=( 'name' => $testUserName, - 'password' => "", # don't worry - the account is disabled + 'password' => "password", # don't worry - the account is disabled 'passwordAge' => 0, 'priv' => USER_PRIV_USER(), 'homeDir' => $ENV{'TEMP'}, @@ -82,7 +82,7 @@ # this will fail if this account actually exists - this is a good thing. $fie=0; UserAdd($dc, 3, \%testUserInfo3, $fie) or die <{'RemoteName'} =~ /PerlTempShare/; } -$drive = Win32::GetNextAvailDrive(); #$drive = 'I:'; -$myRef->{'LocalName'} = $drive; -#print STDERR "mapping to |$drive|\n", Dumper($myRef), "\n"; -Win32::NetResource::AddConnection($myRef,$passwd,$user,0); -err(); - -Win32::NetResource::GetUNCName( $UNCName, $drive ) or print "not "; -print "ok 5\n"; -err(); -deb("uncname is $UNCName"); +$drive = Win32::GetNextAvailDrive(); +deb("drive is $drive"); +if (keys %$myRef) { + $myRef->{'LocalName'} = $drive; + #print STDERR "mapping to |$drive|\n", Dumper($myRef), "\n"; + Win32::NetResource::AddConnection($myRef,$passwd,$user,0); + err(); -Win32::NetResource::CancelConnection($drive,0,1) or print "not "; -print "ok 6\n"; -err(); + Win32::NetResource::GetUNCName( $UNCName, $drive ) or print "not "; + print "ok 5\n"; + err(); + deb("uncname is $UNCName"); + Win32::NetResource::CancelConnection($drive,0,1) or print "not "; + print "ok 6\n"; + err(); +} +else { + print "ok $_ # skipped: share not found\n" for 5..6; +} Win32::NetResource::NetShareDel("PerlTempShare") or print "not "; print "ok 7\n"; err(); diff -urN libwin32-0.171/ODBC/MANIFEST libwin32-0.172/ODBC/MANIFEST --- libwin32-0.171/ODBC/MANIFEST Mon May 14 00:12:26 2001 +++ libwin32-0.172/ODBC/MANIFEST Mon May 14 00:14:12 2001 @@ -12,6 +12,7 @@ ODBC.pm ODBC.xs ODBCbuild.h +ODBCTEST.MDB Odbc.rc README.TXT ROADMAP.TXT diff -urN libwin32-0.171/OLE/Changes libwin32-0.172/OLE/Changes --- libwin32-0.171/OLE/Changes Mon May 14 00:13:10 2001 +++ libwin32-0.172/OLE/Changes Mon May 14 00:14:14 2001 @@ -3,6 +3,24 @@ Changes in version 0.01-0.03 are by Gurusamy Sarathy. All other changes are by Jan Dubois unless attributed otherwise. +0.1501 unreleased + - Don't clobber $1 etc. in AUTOLOAD. Unfortunately Perl doesn't set + POK on the $1 SV, so we still cannot pass it to OLE methods. :( + +0.15 Wed, December 6th, 2000 + - Make sure the OLE browser works with IE5.5 and the latest ActivePerl + - Relax the checks for file existance in Win32::OLE::Const + +0.1403 Tue, November 21st, 2000 + - Win32::OLE::Const: ignore non-existant typelibs (by Richard Letts) + - safeguard against access violation in Dispatch() + - Work around perl_call_sv() bug in ReportOleError(); use G_EVAL and + rethrow the exception to get the runlevel right + +0.1402 Mon, September 25th, 2000 + - Fix potential crash during global cleanup when _Unique is set + (by Rudi Farkas ) + 0.1401 Mon, September 11th, 2000 - fix bug in GetMultiByteEx() sometimes chopping off the last byte diff -urN libwin32-0.171/OLE/OLE.xs libwin32-0.172/OLE/OLE.xs --- libwin32-0.171/OLE/OLE.xs Mon May 14 00:13:10 2001 +++ libwin32-0.172/OLE/OLE.xs Mon May 14 00:14:16 2001 @@ -64,7 +64,7 @@ #undef WORD typedef unsigned short WORD; -#if PATCHLEVEL < 6 +#if PERL_VERSION < 6 # error Win32::OLE requires Perl 5.6.0 or later #endif @@ -864,10 +864,24 @@ } if (cv) { + ENTER; + SAVETMPS; PUSHMARK(sp); XPUSHs(sv); PUTBACK; - perl_call_sv((SV*)cv, G_DISCARD); + perl_call_sv((SV*)cv, G_DISCARD|G_EVAL); + FREETMPS; + LEAVE; + if (SvTRUE(ERRSV)) { +#if defined(ACTIVEPERL_CHANGELIST) || (PERL_VERSION > 6 || PERL_SUBVERSION > 0) + if (sv_isobject(ERRSV)) + croak(Nullch); /* rethrow exception */ + else + croak("%s", SvPV_nolen(ERRSV)); +#else + croak("%s", SvPV_nolen(ERRSV)); +#endif + } } } /* ReportOleError */ @@ -1052,7 +1066,7 @@ ENTER; if (SvPOK(pObj->destroy)) { /* $self->Dispatch($destroy,$retval); */ - EXTEND(sp, 3); + EXTEND(SP, 3); PUSHMARK(sp); PUSHs(self); PUSHs(pObj->destroy); @@ -1074,15 +1088,6 @@ pObj->destroy = NULL; } - if (pObj->flags & OBJFLAG_UNIQUE) { - dPERINTERP; - IUnknown *punk; // XXX check error? - pObj->pDispatch->QueryInterface(IID_IUnknown, (void**)&punk); - hv_delete(g_hv_unique, (char*)&punk, sizeof(punk), G_DISCARD); - DBG((" hv_delete(%08x)", punk)); - punk->Release(); - } - if (pObj->pEventSink) { DBG((" Unadvise connection |%lx|", pObj)); pObj->pEventSink->Unadvise(); @@ -1090,6 +1095,14 @@ } if (pObj->pDispatch) { + if (pObj->flags & OBJFLAG_UNIQUE) { + dPERINTERP; + IUnknown *punk; // XXX check error? + pObj->pDispatch->QueryInterface(IID_IUnknown, (void**)&punk); + hv_delete(g_hv_unique, (char*)&punk, sizeof(punk), G_DISCARD); + DBG((" hv_delete(%08x)", punk)); + punk->Release(); + } DBG((" Release pDispatch")); pObj->pDispatch->Release(); pObj->pDispatch = NULL; @@ -2193,7 +2206,7 @@ CV *cv = perl_get_cv("Win32::COM::GUID::new", FALSE); if (cv) { - EXTEND(sp, 2); + EXTEND(SP, 2); PUSHMARK(sp); PUSHs(sv_2mortal(newSVpv("Win32::COM::GUID", 0))); PUSHs(sv_2mortal(newSVpv((char*)&rguid, sizeof(GUID)))); @@ -3223,7 +3236,7 @@ * the method name and return value. */ PUSHMARK(mark); - EXTEND(sp,2); + EXTEND(SP, 2); for (I32 item = 1; item < items; ++item) ST(2+items-item) = ST(items-item); sp += 2; @@ -3713,7 +3726,7 @@ sv_catpvf(err, " \"%s\"", buffer); if (hr == DISP_E_TYPEMISMATCH || hr == DISP_E_PARAMNOTFOUND) { - if (argErr < dispParams.cNamedArgs) + if (rghe && argErr < dispParams.cNamedArgs) sv_catpvf(err, " argument \"%s\"", hv_iterkey(rghe[argErr], &len)); else @@ -4650,7 +4663,7 @@ XSRETURN_EMPTY; } - AV *res = newAV(); + EXTEND(SP, 5); // Enumerate all Clsids for (DWORD dwClsid=0;; ++dwClsid) { @@ -4703,7 +4716,7 @@ err = RegOpenKeyExW(hKeyClsid, wVersion, 0, KEY_READ, &hKeyVersion); if (err != ERROR_SUCCESS) continue; - + cbTitle = (sizeof(wTitle)/sizeof(wTitle[0])); err = RegQueryValueW(hKeyVersion, NULL, wTitle, &cbTitle); if (err != ERROR_SUCCESS || cbTitle <= 1) @@ -4742,7 +4755,7 @@ NULL, NULL, NULL, &ft); if (err != ERROR_SUCCESS) break; - + W2AHELPER(wLangid, szLangid, sizeof(szLangid)); cbLangid = strlen(szLangid); } @@ -4791,13 +4804,19 @@ err = RegQueryValueA(hKeyLangid, "win32", szFile, &cbFile); } if (err == ERROR_SUCCESS && cbFile > 1) { - AV *av = newAV(); - av_push(av, newSVpv(szClsid, cbClsid)); - av_push(av, newSVpv(szTitle, cbTitle-1)); - av_push(av, newSVpv(szVersion, cbVersion)); - av_push(av, newSVpv(szLangid, cbLangid)); - av_push(av, newSVpv(szFile, cbFile-1)); - av_push(res, newRV_noinc((SV*)av)); + ENTER; + SAVETMPS; + PUSHMARK(SP); + PUSHs(sv_2mortal(newSVpv(szClsid, cbClsid))); + PUSHs(sv_2mortal(newSVpv(szTitle, cbTitle-1))); + PUSHs(sv_2mortal(newSVpv(szVersion, cbVersion))); + PUSHs(sv_2mortal(newSVpv(szLangid, cbLangid))); + PUSHs(sv_2mortal(newSVpv(szFile, cbFile-1))); + PUTBACK; + perl_call_pv("Win32::OLE::Const::_Typelib", G_DISCARD); + SPAGAIN; + FREETMPS; + LEAVE; } RegCloseKey(hKeyLangid); @@ -4807,9 +4826,7 @@ RegCloseKey(hKeyClsid); } RegCloseKey(hKeyTypelib); - - ST(0) = sv_2mortal(newRV_noinc((SV*)res)); - XSRETURN(1); + XSRETURN_EMPTY; } void @@ -6092,7 +6109,7 @@ New(0, pCharType, len, unsigned short); if (GetStringTypeA(lcid, type, string, len, pCharType)) { - EXTEND(sp, len); + EXTEND(SP, len); for (int i=0; i < len; ++i) PUSHs(sv_2mortal(newSViv(pCharType[i]))); } @@ -6105,7 +6122,7 @@ { LANGID langID = GetSystemDefaultLangID(); if (langID != 0) { - EXTEND(sp, 1); + EXTEND(SP, 1); XSRETURN_IV(langID); } } @@ -6116,7 +6133,7 @@ { LCID lcid = GetSystemDefaultLCID(); if (lcid != 0) { - EXTEND(sp, 1); + EXTEND(SP, 1); XSRETURN_IV(lcid); } } @@ -6127,7 +6144,7 @@ { LANGID langID = GetUserDefaultLangID(); if (langID != 0) { - EXTEND(sp, 1); + EXTEND(SP, 1); XSRETURN_IV(langID); } } @@ -6138,7 +6155,7 @@ { LCID lcid = GetUserDefaultLCID(); if (lcid != 0) { - EXTEND(sp, 1); + EXTEND(SP, 1); XSRETURN_IV(lcid); } } diff -urN libwin32-0.171/OLE/browser/Browser.dhtml libwin32-0.172/OLE/browser/Browser.dhtml --- libwin32-0.171/OLE/browser/Browser.dhtml Mon May 14 00:12:26 2001 +++ libwin32-0.172/OLE/browser/Browser.dhtml Mon May 14 00:14:16 2001 @@ -109,10 +109,11 @@ # Use the ActivePerl documentation stylesheet for all frames # ========================================================== -my $css = "$Config{prefix}\\html\\win32prk.css"; +my $css = "$Config{prefix}\\html\\active.css"; +$css = "$Config{prefix}\\html\\win32prk.css" unless -f $css; foreach my $frame (qw(Header Libraries Types Members Footer)) { $frame{$frame} = $window->parent->frames($frame); - $frame{$frame}->document->createStyleSheet($css); + $frame{$frame}->document->createStyleSheet($css) if -f $css; } # Rollon/Rolloff highlighting styles for Libraries, Types and Members @@ -120,6 +121,7 @@ foreach my $frame (qw(Libraries Types Members)) { my $ss = $frame{$frame}->document->createStyleSheet; + next unless $ss; my $cursor = "cursor: hand"; $ss->addRule(".Inactive", "$cursor; color: black"); $ss->addRule(".Active", "$cursor; color: blue"); @@ -157,21 +159,19 @@ # ============================= my $html = < - -   - Win32::OLE - Type Library Browser - - + +
+

 Win32::OLE - Type Library Browser

+
+ onclick="parent.Footer.ShowHidden"> + onclick="parent.Footer.GroupByType">
Show hidden elements:
Group elements by type:

Written by Jan Dubois in 1999. HTML @@ -193,7 +193,7 @@ # ============================= my $ss = $frame{Footer}->document->createStyleSheet; -$ss->addRule(".Indented", "margin-left:48; margin-top:0"); +$ss->addRule(".Indented", "margin-left:48; margin-top:0") if $ss; undef $ss; @@ -214,21 +214,21 @@ # Create list of type libraries # ============================= -$html = "\n"; +$html = "
\n"; for my $id (0..@Library-1) { $html .= < HTML } $html .= "
+ onclick="parent.Footer.selectLibrary" + onmouseover="parent.Footer.rollon('Libraries')" + onmouseout="parent.Footer.rolloff('Libraries')"> $Library[$id]->[libNAME] $Library[$id]->[libMAJOR].$Library[$id]->[libMINOR]
"; -# $frame{Libraries}->document->body->{innerHTML} = $html; -$window->document->write($html); +$frame{Libraries}->document->body->{innerHTML} = $html; +#$window->document->write($html); # Select a type library and display the types # =========================================== @@ -242,7 +242,7 @@ my $tlib; # XXX Hack alert! sub selectLibrary { - my $element = $window->event->srcElement; + my $element = $frame{Libraries}->event->srcElement; $element = $element->parentElement if $element->tagName ne 'TD'; my ($id) = ($element->id =~ /^LIB_(\d+)/); return unless defined $id; @@ -252,24 +252,28 @@ $def[0] = quotemeta $def[0]; my $typelib = Win32::OLE::Const->LoadRegTypeLib(@def); if (Win32::OLE->LastError) { - $window->alert("Cannot load library: ".Win32::OLE->LastError); + $frame{Libraries}->alert("Cannot load library: ".Win32::OLE->LastError); return; } $tlib = $typelib; my $tcount = $tlib->_GetTypeInfoCount; # Change selection marker - $window->document->all("LIB_$Library")->style->{fontWeight} = 'normal' - if defined $Library; + $frame{Libraries}->document->all("LIB_$Library")-> + style->{fontWeight} = 'normal' if defined $Library; $Library = $id; - $window->document->all("LIB_$Library")->style->{fontWeight} = 'bold'; + $frame{Libraries}->document->all("LIB_$Library")-> + style->{fontWeight} = 'bold'; # Hide all interfaces mentioned in a COCLASS definition my %hide; for (0..$tcount-1) { my $tinfo = $tlib->_GetTypeInfo($_); - ++$hide{$tinfo->_GetImplTypeInfo($_)->_GetTypeAttr->{guid}} - foreach 0..$tinfo->_GetTypeAttr->{cImplTypes}-1; + foreach (0..$tinfo->_GetTypeAttr->{cImplTypes}-1) { + my $impltinfo = $tinfo->_GetImplTypeInfo($_); + next unless defined $impltinfo; + ++$hide{$impltinfo->_GetTypeAttr->{guid}}; + } } # Make a sorted list of all type information @@ -301,7 +305,7 @@ $html .= <  + onclick="parent.Footer.showHelpfile">  HTML $html .= "Library $doc->{Name}"; $html .= "

$doc->{HelpFile}" if HelpFile; @@ -337,7 +341,7 @@ } 0..@Type-1; # Create a table of available types - my $html = "\n"; + my $html = "
\n"; foreach (0..@Index-1) { my $id = $Index[$_]; my $name = $Type[$id]->[typeDOC]->{Name}; @@ -346,9 +350,9 @@ my $hidden = $Type[$id]->[typeHIDDEN] ? 'Hidden' : ''; $html .= < HTML } @@ -392,8 +396,9 @@ for my $impltype (0 .. $Type[$Type]->[typeATTR]->{cImplTypes}-1) { my $tflags = $tinfo->_GetImplTypeFlags($impltype); next unless $tflags & IMPLTYPEFLAG_FDEFAULT; - ($tflags & IMPLTYPEFLAG_FSOURCE ? $event : $dispatch) = - $tinfo->_GetImplTypeInfo($impltype); + my $impltinfo = $tinfo->_GetImplTypeInfo($impltype); + next unless defined $impltinfo; + ($tflags & IMPLTYPEFLAG_FSOURCE ? $event : $dispatch) = $impltinfo; } addFunctions($dispatch); addFunctions($event, 'Event'); @@ -461,7 +466,7 @@ my $html = ''; $html .= <{HelpFile};   + STYLE="cursor:hand" onclick="parent.Footer.showHelpfile">  HTML my $type = $icon[$Type[$Type]->[typeATTR]->{typekind}] || '???'; $html .= "$type $doc->{Name}"; @@ -492,7 +497,7 @@ } 0..@Member-1; # Create a table of all members - my $html = "
+ onmouseover="parent.Footer.rollon('Types')" + onmouseout="parent.Footer.rolloff('Types')" + onclick="parent.Footer.selectType"> $name
\n"; + my $html = "
\n"; foreach (0..@Index-1) { my $id = $Index[$_]; my $hidden = $Member[$id]->[membHIDDEN] ? 'Hidden' : ''; @@ -504,9 +509,9 @@ } $html .= < @@ -559,7 +564,7 @@ my $html = ''; $html .= <{HelpFile}; + STYLE="cursor:hand" onclick="parent.Footer.showHelpfile"> HTML my $type = $Member[$Member]->[membICON]; diff -urN libwin32-0.171/OLE/browser/Browser.html libwin32-0.172/OLE/browser/Browser.html --- libwin32-0.171/OLE/browser/Browser.html Mon May 14 00:12:26 2001 +++ libwin32-0.172/OLE/browser/Browser.html Mon May 14 00:14:16 2001 @@ -4,12 +4,12 @@ - + - + <H1>Sorry</H1> <H3>this application only works with Internet Explorer.</H3> diff -urN libwin32-0.171/OLE/lib/Win32/OLE/Const.pm libwin32-0.172/OLE/lib/Win32/OLE/Const.pm --- libwin32-0.171/OLE/lib/Win32/OLE/Const.pm Mon May 14 00:12:26 2001 +++ libwin32-0.172/OLE/lib/Win32/OLE/Const.pm Mon May 14 00:14:16 2001 @@ -6,7 +6,18 @@ use Carp; use Win32::OLE; -my $Typelibs = __PACKAGE__->_Typelibs(); +my $Typelibs; +sub _Typelib { + my ($clsid,$title,$version,$langid,$filename) = @_; + # Filenames might have a resource index appended to it. + $filename = $1 if $filename =~ /^(.*\.(?:dll|exe))(\\\d+)$/i; + # Ignore if it looks like a file but doesn't exist. + # We don't verify existance of monikers or filenames + # without a full pathname. + return unless -f $filename || $filename !~ /^\w:\\.*\.(exe|dll)$/; + push @$Typelibs, \@_; +} +__PACKAGE__->_Typelibs; sub import { my ($self,$name,$major,$minor,$language,$codepage) = @_; diff -urN libwin32-0.171/OLE/lib/Win32/OLE/Lite.pm libwin32-0.172/OLE/lib/Win32/OLE/Lite.pm --- libwin32-0.171/OLE/lib/Win32/OLE/Lite.pm Mon May 14 00:12:26 2001 +++ libwin32-0.172/OLE/lib/Win32/OLE/Lite.pm Mon May 14 00:14:16 2001 @@ -148,12 +148,11 @@ sub AUTOLOAD { my $self = shift; - $AUTOLOAD =~ s/.*:://o; - _croak("Cannot autoload class method \"$AUTOLOAD\"") - unless ref($self) && UNIVERSAL::isa($self, 'Win32::OLE'); + $AUTOLOAD = substr $AUTOLOAD, rindex($AUTOLOAD, ':')+1; + _croak("Cannot autoload class method \"$AUTOLOAD\"") + unless ref($self) && UNIVERSAL::isa($self, 'Win32::OLE'); my $success = $self->Dispatch($AUTOLOAD, my $retval, @_); unless (defined $success || ($^H & 0x200) != 0) { - warn "retrying default method"; # Retry default method if C<no strict 'subs';> $self->Dispatch(undef, $retval, $AUTOLOAD, @_); } diff -urN libwin32-0.171/OLE/lib/Win32/OLE/TPJ.pod libwin32-0.172/OLE/lib/Win32/OLE/TPJ.pod --- libwin32-0.171/OLE/lib/Win32/OLE/TPJ.pod Mon May 14 00:12:26 2001 +++ libwin32-0.172/OLE/lib/Win32/OLE/TPJ.pod Mon May 14 00:14:17 2001 @@ -1,6 +1,10 @@ =pod -=head1 Win32::OLE +=head1 NAME + +The Perl Journal #10 - Win32::OLE by Jan Dubois + +=head1 INTRODUCTION Suppose you're composing a document with Microsoft Word. You want to include an Excel spreadsheet. You could save the spreadsheet in some diff -urN libwin32-0.171/OLE/lib/Win32/OLE.pm libwin32-0.172/OLE/lib/Win32/OLE.pm --- libwin32-0.171/OLE/lib/Win32/OLE.pm Mon May 14 00:13:10 2001 +++ libwin32-0.172/OLE/lib/Win32/OLE.pm Mon May 14 00:14:16 2001 @@ -6,7 +6,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @EXPORT_FAIL $AUTOLOAD $CP $LCID $Warn $LastError $_NewEnum $_Unique); -$VERSION = '0.1401'; +$VERSION = '0.1501'; use Carp; use Exporter; @@ -949,6 +949,6 @@ =head1 VERSION -Version 0.1401 11 September 2000 +Version 0.1501 6 February 2001 =cut diff -urN libwin32-0.171/OLE/t/3_ole.t libwin32-0.172/OLE/t/3_ole.t --- libwin32-0.171/OLE/t/3_ole.t Mon May 14 00:13:10 2001 +++ libwin32-0.172/OLE/t/3_ole.t Mon May 14 00:14:17 2001 @@ -25,7 +25,7 @@ sub AUTOLOAD { my $self = shift; - $AUTOLOAD =~ s/.*::/SUPER::/; + $AUTOLOAD = "SUPER::" . substr $AUTOLOAD, rindex($AUTOLOAD, ':')+1; my $retval = $self->$AUTOLOAD(@_); return $retval if defined($retval) || $AUTOLOAD eq 'DESTROY'; printf "# $AUTOLOAD returned OLE error 0x%08x\n", $LastError; @@ -211,31 +211,48 @@ print "not " unless $Cell->{Value} == 25; printf "ok %d\n", ++$Test; -# 15. Test the valof function +# 15. Call OLE method with $1 as argument + +# This test is commented out because Perl doesn't set POK on $1, +# it seems to be only pPOK, which still gets translated to undef. :( + +#Excel->Option(Warn => 0); +#$_ = "The formula is MIN(77,33,55)"; +#print "# Expression is \"$1\"\n" if /is (.*)/; +##$Value = $Sheet->Evaluate("MIN(77,33,55)") if /is (.*)/; +#$Value = $Sheet->Evaluate($1) if /is (.*)/; +#Excel->Option(Warn => 2); +#$Value = "" unless defined $Value; +#print "# Value is \"$Value\"\n"; +#print "not " unless $Value eq "33"; + +printf "ok %d\n", ++$Test; + +# 16. Test the valof function my $RefOf = $Cell; my $ValOf = valof $Cell; $Cell->{Value} = 27; print "not " unless $ValOf == 25 && $RefOf->Value == 27; printf "ok %d\n", ++$Test; -# 16. Assign and retrieve a very long string +# 17. Assign and retrieve a very long string $Cell->{Value} = 'a' x 300; printf "# Value is %s\n", $Cell->Value; print "not " unless $Cell->Value eq ('a' x 300); printf "ok %d\n", ++$Test; -# 17. Test 'SetProperty' function +# 18. Test 'SetProperty' function $Cell->SetProperty('Value', 4711); printf "# Value is %s\n", $Cell->Value; print "not " unless $Cell->Value == 4711; printf "ok %d\n", ++$Test; -# 18. The following tests rely on the fact that the font is not yet bold +# 19. The following tests rely on the fact that the font is not yet bold printf "# Bold: %s\n", $Cell->Style->Font->Bold; print "not " if $Cell->Style->Font->Bold; printf "ok %d\n", ++$Test; -# 19. Assignment by DISPATCH_PROPERTYPUTREF shouldn't work +# 20. Assignment by DISPATCH_PROPERTYPUTREF shouldn't work my $Style = $Book->Styles->Add("MyStyle"); $Style->Font->{Bold} = 1; { local $Excel::Warn = 0; $Cell->{Style} = $Style } @@ -245,63 +262,63 @@ print "not " if $LastError != HRESULT(0x80020003) || $Cell->Style->Font->Bold; printf "ok %d\n", ++$Test; -# 20. But DISPATCH_PROPERTYPUT should be ok +# 21. But DISPATCH_PROPERTYPUT should be ok $Cell->LetProperty('Style', $Style); printf "# Bold: %s\n", $Cell->Style->Font->Bold; print "not " unless $Cell->Style->Font->Bold; printf "ok %d\n", ++$Test; -# 21. Set a cell range from an array ref containing an IV, PV and NV +# 22. Set a cell range from an array ref containing an IV, PV and NV $Sheet->Range("A8:C9")->{Value} = [[undef, 'Camel'],[42, 'Perl', 3.1415]]; $Value = $Sheet->Cells(9,2)->Value . $Sheet->Cells(8,2)->Value; print "# Value is \"$Value\"\n"; print "not " unless $Value eq 'PerlCamel'; printf "ok %d\n", ++$Test; -# 22. Retrieve float value (esp. interesting in foreign locales) +# 23. Retrieve float value (esp. interesting in foreign locales) $Value = $Sheet->Cells(9,3)->{Value}; print "# Value is \"$Value\"\n"; print "not " unless $Value == 3.1415; printf "ok %d\n", ++$Test; -# 23. Retrieve a 0 dimensional range; check array data structure +# 24. Retrieve a 0 dimensional range; check array data structure $Value = $Sheet->Range("B8")->{Value}; printf "# Values are: \"%s\"\n", stringify($Value); print "not " if ref $Value; printf "ok %d\n", ++$Test; -# 24. Retrieve a 1 dimensional row range; check array data structure +# 25. Retrieve a 1 dimensional row range; check array data structure $Value = $Sheet->Range("B8:C8")->{Value}; printf "# Values are: \"%s\"\n", stringify($Value); print "not " unless @$Value == 1 && ref $$Value[0]; printf "ok %d\n", ++$Test; -# 25. Retrieve a 1 dimensional column range; check array data structure +# 26. Retrieve a 1 dimensional column range; check array data structure $Value = $Sheet->Range("B8:B9")->{Value}; printf "# Values are: \"%s\"\n", stringify($Value); print "not " unless @$Value == 2 && ref $$Value[0] && ref $$Value[1]; printf "ok %d\n", ++$Test; -# 26. Retrieve a 2 dimensional range; check array data structure +# 27. Retrieve a 2 dimensional range; check array data structure $Value = $Sheet->Range("B8:C9")->{Value}; printf "# Values are: \"%s\"\n", stringify($Value); print "not " unless @$Value == 2 && ref $$Value[0] && ref $$Value[1]; printf "ok %d\n", ++$Test; -# 27. Check contents of 2 dimensional array +# 28. Check contents of 2 dimensional array $Value = $$Value[0][0] . $$Value[1][0] . $$Value[1][1]; print "# Value is \"$Value\"\n"; print "not " unless $Value eq 'CamelPerl3.1415'; printf "ok %d\n", ++$Test; -# 28. Set a cell formula and retrieve calculated value +# 29. Set a cell formula and retrieve calculated value $Sheet->Cells(3,1)->{Formula} = '=PI()'; $Value = $Sheet->Cells(3,1)->{Value}; print "# Value is \"$Value\"\n"; print "not " unless abs($Value-3.141592) < 0.00001; printf "ok %d\n", ++$Test; -# 29. Add single worksheet and check that worksheet count is incremented +# 30. Add single worksheet and check that worksheet count is incremented my $Count = $Sheets->{Count}; $Book->Worksheets->Add; $Value = $Sheets->{Count}; @@ -309,7 +326,7 @@ print "not " unless $Value == $Count+1; printf "ok %d\n", ++$Test; -# 30. Add 2 more sheets, optional arguments are omitted +# 31. Add 2 more sheets, optional arguments are omitted $Count = $Sheets->{Count}; $Book->Worksheets->Add(undef,undef,2); $Value = $Sheets->{Count}; @@ -317,7 +334,7 @@ print "not " unless $Value == $Count+2; printf "ok %d\n", ++$Test; -# 31. Add 3 more sheets before sheet 2 using a named argument +# 32. Add 3 more sheets before sheet 2 using a named argument $Count = $Sheets->{Count}; $Book->Worksheets(2)->{Name} = 'XYZZY'; $Sheets->Add($Book->Worksheets(2), {Count => 3}); @@ -326,13 +343,13 @@ print "not " unless $Value == $Count+3; printf "ok %d\n", ++$Test; -# 32. Previous sheet 2 should now be sheet 5 +# 33. Previous sheet 2 should now be sheet 5 $Value = $Book->Worksheets(5)->{Name}; print "# Value is \"$Value\"\n"; print "not " unless $Value eq 'XYZZY'; printf "ok %d\n", ++$Test; -# 33. Add 2 more sheets at the end using 2 named arguments +# 34. Add 2 more sheets at the end using 2 named arguments $Count = $Sheets->{Count}; # Following line doesn't work with Excel 7 (Seems like an Excel bug?) # $Sheets->Add({Count => 2, After => $Book->Worksheets($Sheets->{Count})}); @@ -340,7 +357,7 @@ print "not " unless $Sheets->{Count} == $Count+2; printf "ok %d\n", ++$Test; -# 34. Number of objects in an enumeration must match its "Count" property +# 35. Number of objects in an enumeration must match its "Count" property my @Sheets = in $Sheets; printf "# \$Sheets->{Count} is %d\n", $Sheets->{Count}; printf "# scalar(\@Sheets) is %d\n", scalar(@Sheets); @@ -351,7 +368,7 @@ printf "ok %d\n", ++$Test; undef @Sheets; -# 35. Enumerate all application properties using the C<keys> function +# 36. Enumerate all application properties using the C<keys> function my @Properties = keys %$Excel; printf "# Number of Excel application properties: %d\n", scalar(@Properties); $Value = grep /^(Parent|Xyzzy|Name)$/, @Properties; @@ -360,7 +377,7 @@ printf "ok %d\n", ++$Test; undef @Properties; -# 36. Translate character from ANSI -> OEM +# 37. Translate character from ANSI -> OEM my ($Version) = $Excel->{Version} =~ /([0-9.]+)/; print "# Excel version is $Version\n"; @@ -379,15 +396,15 @@ print "not " unless ord($ANSI) == 163 && ord($OEM) == 156; printf "ok %d\n", ++$Test; -# 37. Save workbook to file +# 38. Save workbook to file print "not " unless $Book->SaveAs($File); printf "ok %d\n", ++$Test; -# 38. Check if output file exists. +# 39. Check if output file exists. print "not " unless -f $File; printf "ok %d\n", ++$Test; -# 39. Access the same file object through a moniker. +# 40. Access the same file object through a moniker. $Obj = Win32::OLE->GetObject($File); for ($Count=0 ; $Count < 5 ; ++$Count) { my $Type = Win32::OLE->QueryObjectType($Obj); @@ -402,7 +419,7 @@ printf "ok %d\n", ++$Test; -# 40. Get return value as Win32::OLE::Variant object +# 41. Get return value as Win32::OLE::Variant object $Cell = $Obj->Worksheets('My Sheet #1')->Range('B9'); my $Variant = Win32::OLE::Variant->new(VT_EMPTY); $Cell->Dispatch('Value', $Variant); @@ -410,7 +427,7 @@ print "not " unless $Variant->Type == VT_BSTR && $Variant->Value eq 'Perl'; printf "ok %d\n", ++$Test; -# 41. Use clsid string to start OLE server +# 42. Use clsid string to start OLE server undef $Value; eval { require Win32::Registry; @@ -434,7 +451,7 @@ printf "ok %d\n", $Test; } -# 42. Use DCOM syntax to start server (on local machine though) +# 43. Use DCOM syntax to start server (on local machine though) # This might fail (on Win95/NT3.5 if DCOM support is not installed. $Obj = Win32::OLE->new([hostname, 'Excel.Application'], 'Quit'); $Value = (Win32::OLE->QueryObjectType($Obj))[0]; @@ -442,11 +459,12 @@ print "not " unless $Value eq 'Excel'; printf "ok %d\n", ++$Test; -# 43. Find $Excel object via EnumAllObjects() +# 44. Find $Excel object via EnumAllObjects() my $Found = 0; $Count = Win32::OLE->EnumAllObjects(sub { my $Object = shift; my $Class = Win32::OLE->QueryObjectType($Object); + $Class = "" unless defined $Class; printf "# Object=%s Class=%s\n", $Object, $Class; $Found = 1 if $Object == $Excel; }); @@ -454,38 +472,38 @@ print "not " unless $Found; printf "ok %d\n", ++$Test; -# 44. _NewEnum should normally be non-browseable +# 45. _NewEnum should normally be non-browseable my $Exists = grep /^_NewEnum$/, keys %{$Excel->Worksheets}; print "# Exists=$Exists\n"; print "not " if $Exists; printf "ok %d\n", ++$Test; -# 45. make _NewEnum visible +# 46. make _NewEnum visible Excel->Option(_NewEnum => 1); $Exists = grep /^_NewEnum$/, keys %{$Excel->Worksheets}; print "# Exists=$Exists\n"; print "not " unless $Exists; printf "ok %d\n", ++$Test; -# 46. _NewEnum available as a method +# 47. _NewEnum available as a method @Sheets = @{$Excel->Worksheets->_NewEnum}; print "# $_->{Name}\n" foreach @Sheets; print "not " unless @Sheets == 11 && grep $_->Name eq "My Sheet #1", @Sheets; printf "ok %d\n", ++$Test; -# 47. _NewEnum available as a property +# 48. _NewEnum available as a property @Sheets = @{$Excel->Worksheets->{_NewEnum}}; print "not " unless @Sheets == 11 && grep $_->Name eq "My Sheet #1", @Sheets; printf "ok %d\n", ++$Test; -# 48. Win32::OLE proxies are non-unique by default +# 49. Win32::OLE proxies are non-unique by default my $Application = $Excel->Application; my $Parent = $Excel->Parent; printf "# Application=%d Parent=%d\n", $Application, $Parent; print "not " if $Application == $Parent; printf "ok %d\n", ++$Test; -# 49. Parent and Application property should now return the same object +# 50. Parent and Application property should now return the same object Excel->Option(_Unique => 1); $Application = $Excel->Application; $Parent = $Excel->Parent; @@ -493,5 +511,5 @@ print "not " unless $Application == $Parent; printf "ok %d\n", ++$Test; -# 50. Terminate server instance ("ok $Test\n" printed by Excel destructor) +# 51. Terminate server instance ("ok $Test\n" printed by Excel destructor) exit; diff -urN libwin32-0.171/Process/Changes libwin32-0.172/Process/Changes --- libwin32-0.171/Process/Changes Mon May 14 00:12:26 2001 +++ libwin32-0.172/Process/Changes Mon May 14 00:14:18 2001 @@ -1,8 +1,13 @@ Revision history for Perl extension Win32::Process. +0.08 Tue Dec 26 2000 + - make sure the environment is correctly inherited by the new + process. Only implemented in non-Unicode branch! + (by Jan Dubois <jand@ActiveState.com>) + 0.07 Mon May 22 21:45:19 2000 - support for passing Unicode strings to methods (thanks to - Doug Lankshear <dougl@activestate.com>) + Doug Lankshear <dougl@ActiveState.com>) 0.06 Sat Sep 25 15:33:29 1999 - added GetProcessID() and KillProcess() (suggested by diff -urN libwin32-0.171/Process/Process.hpp libwin32-0.172/Process/Process.hpp --- libwin32-0.171/Process/Process.hpp Mon May 14 00:12:26 2001 +++ libwin32-0.172/Process/Process.hpp Mon May 14 00:14:18 2001 @@ -21,7 +21,7 @@ BOOL bRetVal; cProcess(char* szAppName, char* szCommLine, BOOL Inherit, - DWORD CreateFlags, char* szCurrDir) + DWORD CreateFlags, void *env, char* szCurrDir) { STARTUPINFOA st; PROCESS_INFORMATION procinfo; @@ -37,7 +37,7 @@ th = NULL; bRetVal = CreateProcessA(szAppName,szCommLine,NULL,NULL, - Inherit,CreateFlags,NULL,szCurrDir, + Inherit,CreateFlags,env,szCurrDir, &st,&procinfo); if (bRetVal) { diff -urN libwin32-0.171/Process/Process.pm libwin32-0.172/Process/Process.pm --- libwin32-0.171/Process/Process.pm Mon May 14 00:13:10 2001 +++ libwin32-0.172/Process/Process.pm Mon May 14 00:14:18 2001 @@ -4,7 +4,7 @@ require DynaLoader; @ISA = qw(Exporter DynaLoader); -$VERSION = '0.07'; +$VERSION = '0.08'; # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. diff -urN libwin32-0.171/Process/Process.xs libwin32-0.172/Process/Process.xs --- libwin32-0.171/Process/Process.xs Mon May 14 00:12:26 2001 +++ libwin32-0.172/Process/Process.xs Mon May 14 00:14:18 2001 @@ -15,23 +15,36 @@ #include "../ppport.h" - static BOOL -Create(cProcess* &cP,char* szAppName,char* szCommLine,DWORD Inherit,DWORD CreateFlags,char* szCurrDir) +Create(cProcess* &cP, char* szAppName, char* szCommLine, DWORD Inherit, + DWORD CreateFlags, char* szCurrDir) { + BOOL bRetVal; + void *env = NULL; +#if PERL_VERSION > 5 + env = PerlEnv_get_childenv(); +#endif cP = NULL; try { - cP =(cProcess *) new cProcess(szAppName,szCommLine,Inherit,CreateFlags,szCurrDir); + cP = (cProcess*)new cProcess(szAppName,szCommLine,Inherit,CreateFlags, + env,szCurrDir); + bRetVal = cP->bRetVal; } catch (...) { - return(FALSE); + bRetVal = FALSE; } - return(cP->bRetVal); +#if PERL_VERSION > 5 + PerlEnv_free_childenv(env); +#endif + return bRetVal; } static BOOL CreateW(cProcess* &cP,WCHAR* szAppName,WCHAR* szCommLine,DWORD Inherit,DWORD CreateFlags,WCHAR* szCurrDir) { + // XXX environment will *not* be correctly inherited. + // Alas, we don't have corresponding Unicode accessor + // functions for the hosts environment. cP = NULL; try { cP =(cProcess *) new cProcess(szAppName,szCommLine,Inherit,CreateFlags,szCurrDir); diff -urN libwin32-0.171/Win32.pm libwin32-0.172/Win32.pm --- libwin32-0.171/Win32.pm Mon May 14 00:13:10 2001 +++ libwin32-0.172/Win32.pm Mon May 14 00:14:19 2001 @@ -6,7 +6,7 @@ # included with the latest builds of the ActivePerl distribution.) # -$VERSION = $VERSION = '0.171'; +$VERSION = $VERSION = '0.172'; require Exporter; require DynaLoader; diff -urN libwin32-0.171/Win32.xs libwin32-0.172/Win32.xs --- libwin32-0.171/Win32.xs Mon May 14 00:12:26 2001 +++ libwin32-0.172/Win32.xs Mon May 14 00:14:20 2001 @@ -1,3 +1,5 @@ +#include <windows.h> + #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -431,6 +433,25 @@ XSRETURN_IV(sysinfo.dwProcessorType); } +XS(w32_GuidGen) +{ + dXSARGS; + GUID guid; + char szGUID[50] = {'\0'}; + HRESULT hr = CoCreateGuid(&guid); + + if (SUCCEEDED(hr)) { + LPOLESTR pStr = NULL; + StringFromCLSID(&guid, &pStr); + WideCharToMultiByte(CP_ACP, 0, pStr, wcslen(pStr), szGUID, + sizeof(szGUID), NULL, NULL); + + XSRETURN_PV(szGUID); + } + else + XSRETURN_UNDEF; +} + XS(boot_Win32) { dXSARGS; @@ -449,6 +470,7 @@ newXS("Win32::UnregisterServer", w32_UnregisterServer, file); newXS("Win32::GetArchName", w32_GetArchName, file); newXS("Win32::GetChipName", w32_GetChipName, file); + newXS("Win32::GuidGen", w32_GuidGen, file); XSRETURN_YES; } End of Patch.
+ onmouseover="parent.Footer.rollon('Members')" + onmouseout="parent.Footer.rolloff('Members')" + onclick="parent.Footer.selectMember"> $default $Member[$id]->[membDOC]->{Name}