summaryrefslogtreecommitdiff
path: root/lib/chef/win32/api
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-27 14:02:54 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-08-28 17:19:34 -0700
commit306423bac260655a9d4b4b152782401f03325519 (patch)
tree0b60a527c8e6a155539b7abd0912ae6b1498514b /lib/chef/win32/api
parenta9524b0e799c13e90aef846e96c8d32909b5ee39 (diff)
downloadchef-306423bac260655a9d4b4b152782401f03325519.tar.gz
Use FFI for NetUseDel
Diffstat (limited to 'lib/chef/win32/api')
-rw-r--r--lib/chef/win32/api/net.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb
index 0519e93a96..a7e20d0aeb 100644
--- a/lib/chef/win32/api/net.rb
+++ b/lib/chef/win32/api/net.rb
@@ -40,6 +40,10 @@ class Chef
UF_NORMAL_ACCOUNT = 0x000200
UF_DONT_EXPIRE_PASSWD = 0x010000
+ USE_NOFORCE = 0
+ USE_FORCE = 1
+ USE_LOTS_OF_FORCE = 2 #every windows API should support this flag
+
NERR_Success = 0
NERR_InvalidComputer = 2351
NERR_NotPrimary = 2226
@@ -272,6 +276,13 @@ class Chef
#);
safe_attach_function :NetUserDel, [:LPCWSTR, :LPCWSTR], :DWORD
+#NET_API_STATUS NetUseDel(
+ #_In_ LMSTR UncServerName,
+ #_In_ LMSTR UseName,
+ #_In_ DWORD ForceCond
+#);
+ safe_attach_function :NetUseDel, [:LMSTR, :LMSTR, :DWORD], :DWORD
+
end
end
end