diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-07-30 08:11:06 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-07-30 08:11:06 -0700 |
commit | b712f13d2f24dfdcb5c2782fcd17c3e864aaee43 (patch) | |
tree | 3b658e406c2c59e6861010b136df528893774453 /lib/chef/win32 | |
parent | f1ca00c684cb06b0792a71579526a508e5ecb408 (diff) | |
download | chef-b712f13d2f24dfdcb5c2782fcd17c3e864aaee43.tar.gz |
FFYify NetLocalGroupSetMembers
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/api/net.rb | 18 | ||||
-rw-r--r-- | lib/chef/win32/net.rb | 13 |
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb index d02add9c2c..082cf4bb9a 100644 --- a/lib/chef/win32/api/net.rb +++ b/lib/chef/win32/api/net.rb @@ -209,6 +209,24 @@ class Chef #); safe_attach_function :NetLocalGroupAddMembers, [:LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD +#NET_API_STATUS NetLocalGroupSetMembers( +# _In_ LPCWSTR servername, +# _In_ LPCWSTR groupname, +# _In_ DWORD level, +# _In_ LPBYTE buf, +# _In_ DWORD totalentries +#); + safe_attach_function :NetLocalGroupSetMembers, [:LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD + +#NET_API_STATUS NetLocalGroupDelMembers( +# _In_ LPCWSTR servername, +# _In_ LPCWSTR groupname, +# _In_ DWORD level, +# _In_ LPBYTE buf, +# _In_ DWORD totalentries +#); + safe_attach_function :NetLocalGroupDelMembers, [:LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD + #NET_API_STATUS NetUserGetInfo( # _In_ LPCWSTR servername, # _In_ LPCWSTR username, diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index afbe9f6ebf..5027de3e90 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -260,6 +260,19 @@ END net_api_error!(rc) end end + + def self.net_local_group_set_members(server_name, group_name, members) + server_name = wstring(server_name) + group_name = wstring(group_name) + + lgrmi3s = members_to_lgrmi3(members) + rc = NetLocalGroupSetMembers( + server_name, group_name, 3, lgrmi3s[0], members.size) + + if rc != NERR_Success + net_api_error!(rc) + end + end end end end |