From cdad2f684debda15e8cf773185e78f93892eda35 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 2 Jul 2018 10:31:50 -0700 Subject: fix Layout/LeadingCommentSpace Signed-off-by: Lamont Granquist --- lib/chef/win32/api.rb | 12 +-- lib/chef/win32/api/error.rb | 4 +- lib/chef/win32/api/file.rb | 24 +++--- lib/chef/win32/api/net.rb | 116 ++++++++++++++-------------- lib/chef/win32/security/securable_object.rb | 8 +- 5 files changed, 82 insertions(+), 82 deletions(-) (limited to 'lib/chef/win32') diff --git a/lib/chef/win32/api.rb b/lib/chef/win32/api.rb index 503920a0ed..fccedd1d54 100644 --- a/lib/chef/win32/api.rb +++ b/lib/chef/win32/api.rb @@ -51,7 +51,7 @@ class Chef host.typedef :bool, :BOOL host.typedef :bool, :BOOLEAN host.typedef :uchar, :BYTE # Byte (8 bits). Declared as unsigned char - #CALLBACK: K, # Win32.API gem-specific ?? MSDN: #define CALLBACK __stdcall + # CALLBACK: K, # Win32.API gem-specific ?? MSDN: #define CALLBACK __stdcall host.typedef :char, :CHAR # 8-bit Windows (ANSI) character. See http://msdn.microsoft.com/en-us/library/dd183415%28VS.85%29.aspx host.typedef :uint32, :COLORREF # Red, green, blue (RGB) color value (32 bits). See COLORREF for more info. host.typedef :uint32, :DWORD # 32-bit unsigned integer. The range is 0 through 4,294,967,295 decimal. @@ -78,7 +78,7 @@ class Chef host.typedef :ulong, :HDESK # (L) Handle to a desktop. http://msdn.microsoft.com/en-us/library/ms682573%28VS.85%29.aspx host.typedef :ulong, :HDROP # (L) Handle to an internal drop structure. host.typedef :ulong, :HDWP # (L) Handle to a deferred window position structure. - host.typedef :ulong, :HENHMETAFILE #(L) Handle to an enhanced metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx + host.typedef :ulong, :HENHMETAFILE # (L) Handle to an enhanced metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx host.typedef :uint, :HFILE # (I) Special file handle to a file opened by OpenFile, not CreateFile. # WinDef.h: #host.typedef int HFILE; host.typedef :ulong, :HFONT # (L) Handle to a font. http://msdn.microsoft.com/en-us/library/dd162470%28VS.85%29.aspx @@ -107,7 +107,7 @@ class Chef host.typedef :int, :INT # 32-bit signed integer. The range is -2147483648 through 2147483647 decimal. host.typedef :int, :INT_PTR # Signed integer type for pointer precision. Use when casting a pointer to an integer # to perform pointer arithmetic. BaseTsd.h: - #if defined(_WIN64) host.typedef __int64 INT_PTR; #else host.typedef int INT_PTR; + # if defined(_WIN64) host.typedef __int64 INT_PTR; #else host.typedef int INT_PTR; host.typedef :int32, :INT32 # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal. host.typedef :int64, :INT64 # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807 host.typedef :ushort, :LANGID # Language identifier. For more information, see Locales. WinNT.h: #host.typedef WORD LANGID; @@ -122,7 +122,7 @@ class Chef host.typedef :int64, :LONGLONG # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807 host.typedef :long, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to # perform pointer arithmetic. BaseTsd.h: - #if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR; + # if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR; host.typedef :long, :LPARAM # Message parameter. WinDef.h as follows: #host.typedef LONG_PTR LPARAM; host.typedef :pointer, :LPBOOL # Pointer to a BOOL. WinDef.h as follows: #host.typedef BOOL far *LPBOOL; host.typedef :pointer, :LPBYTE # Pointer to a BYTE. WinDef.h as follows: #host.typedef BYTE far *LPBYTE; @@ -160,7 +160,7 @@ class Chef host.typedef :pointer, :PDWORD32 # Pointer to a DWORD32. host.typedef :pointer, :PDWORD64 # Pointer to a DWORD64. host.typedef :pointer, :PFLOAT # Pointer to a FLOAT. - host.typedef :pointer, :PGENERICMAPPING #Pointer to GENERIC_MAPPING + host.typedef :pointer, :PGENERICMAPPING # Pointer to GENERIC_MAPPING host.typedef :pointer, :PHALF_PTR # Pointer to a HALF_PTR. host.typedef :pointer, :PHANDLE # Pointer to a HANDLE. host.typedef :pointer, :PHKEY # Pointer to an HKEY. @@ -235,7 +235,7 @@ class Chef host.typedef :ulong_long, :USN # Update sequence number (USN). host.typedef :ushort, :WCHAR # 16-bit Unicode character. For more information, see Character Sets Used By Fonts. # In WinNT.h: host.typedef wchar_t WCHAR; - #WINAPI: K, # Calling convention for system functions. WinDef.h: define WINAPI __stdcall + # WINAPI: K, # Calling convention for system functions. WinDef.h: define WINAPI __stdcall host.typedef :ushort, :WORD # 16-bit unsigned integer. The range is 0 through 65535 decimal. host.typedef :uint, :WPARAM # Message parameter. WinDef.h as follows: host.typedef UINT_PTR WPARAM; end diff --git a/lib/chef/win32/api/error.rb b/lib/chef/win32/api/error.rb index 758eb98874..e37468c609 100644 --- a/lib/chef/win32/api/error.rb +++ b/lib/chef/win32/api/error.rb @@ -211,9 +211,9 @@ class Chef ERROR_META_EXPANSION_TOO_LONG = 208 # if "*a" > 8.3 ERROR_INVALID_SIGNAL_NUMBER = 209 ERROR_THREAD_1_INACTIVE = 210 - ERROR_INFO_NOT_AVAIL = 211 #@@ PTM 5550 + ERROR_INFO_NOT_AVAIL = 211 # @@ PTM 5550 ERROR_LOCKED = 212 - ERROR_BAD_DYNALINK = 213 #@@ PTM 5760 + ERROR_BAD_DYNALINK = 213 # @@ PTM 5760 ERROR_TOO_MANY_MODULES = 214 ERROR_NESTING_NOT_ALLOWED = 215 ERROR_EXE_MACHINE_TYPE_MISMATCH = 216 diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index 6aa2927e1f..a239671557 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -461,22 +461,22 @@ BOOL WINAPI DeviceIoControl( =end safe_attach_function :DeviceIoControl, [:HANDLE, :DWORD, :LPVOID, :DWORD, :LPVOID, :DWORD, :LPDWORD, :pointer], :BOOL -#BOOL WINAPI DeleteVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint -#); +# BOOL WINAPI DeleteVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint +# ); safe_attach_function :DeleteVolumeMountPointW, [:LPCTSTR], :BOOL -#BOOL WINAPI SetVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint, - #_In_ LPCTSTR lpszVolumeName -#); +# BOOL WINAPI SetVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _In_ LPCTSTR lpszVolumeName +# ); safe_attach_function :SetVolumeMountPointW, [:LPCTSTR, :LPCTSTR], :BOOL -#BOOL WINAPI GetVolumeNameForVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint, - #_Out_ LPTSTR lpszVolumeName, - #_In_ DWORD cchBufferLength -#); +# BOOL WINAPI GetVolumeNameForVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _Out_ LPTSTR lpszVolumeName, + # _In_ DWORD cchBufferLength +# ); safe_attach_function :GetVolumeNameForVolumeMountPointW, [:LPCTSTR, :LPTSTR, :DWORD], :BOOL =begin diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb index 169c68bbdf..e7c191dd9c 100644 --- a/lib/chef/win32/api/net.rb +++ b/lib/chef/win32/api/net.rb @@ -43,7 +43,7 @@ class Chef USE_NOFORCE = 0 USE_FORCE = 1 - USE_LOTS_OF_FORCE = 2 #every windows API should support this flag + USE_LOTS_OF_FORCE = 2 # every windows API should support this flag NERR_Success = 0 # rubocop:disable Naming/ConstantName ERROR_MORE_DATA = 234 @@ -158,32 +158,32 @@ class Chef :ui2_domainname, :LMSTR end - #NET_API_STATUS NetLocalGroupAdd( - #_In_ LPCWSTR servername, - #_In_ DWORD level, - #_In_ LPBYTE buf, - #_Out_ LPDWORD parm_err - #); + # NET_API_STATUS NetLocalGroupAdd( + # _In_ LPCWSTR servername, + # _In_ DWORD level, + # _In_ LPBYTE buf, + # _Out_ LPDWORD parm_err + # ); safe_attach_function :NetLocalGroupAdd, [ :LPCWSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetLocalGroupDel( - #_In_ LPCWSTR servername, - #_In_ LPCWSTR groupname - #); + # NET_API_STATUS NetLocalGroupDel( + # _In_ LPCWSTR servername, + # _In_ LPCWSTR groupname + # ); safe_attach_function :NetLocalGroupDel, [:LPCWSTR, :LPCWSTR], :DWORD - #NET_API_STATUS NetLocalGroupGetMembers( - #_In_ LPCWSTR servername, - #_In_ LPCWSTR localgroupname, - #_In_ DWORD level, - #_Out_ LPBYTE *bufptr, - #_In_ DWORD prefmaxlen, - #_Out_ LPDWORD entriesread, - #_Out_ LPDWORD totalentries, - #_Inout_ PDWORD_PTR resumehandle - #); + # NET_API_STATUS NetLocalGroupGetMembers( + # _In_ LPCWSTR servername, + # _In_ LPCWSTR localgroupname, + # _In_ DWORD level, + # _Out_ LPBYTE *bufptr, + # _In_ DWORD prefmaxlen, + # _Out_ LPDWORD entriesread, + # _Out_ LPDWORD totalentries, + # _Inout_ PDWORD_PTR resumehandle + # ); safe_attach_function :NetLocalGroupGetMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD, :LPDWORD, :LPDWORD, :PDWORD_PTR @@ -209,102 +209,102 @@ class Chef # ); safe_attach_function :NetApiBufferFree, [:LPVOID], :DWORD - #NET_API_STATUS NetUserAdd( - #_In_ LMSTR servername, - #_In_ DWORD level, - #_In_ LPBYTE buf, - #_Out_ LPDWORD parm_err - #); + # NET_API_STATUS NetUserAdd( + # _In_ LMSTR servername, + # _In_ DWORD level, + # _In_ LPBYTE buf, + # _Out_ LPDWORD parm_err + # ); safe_attach_function :NetUserAdd, [ :LMSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetLocalGroupAddMembers( + # NET_API_STATUS NetLocalGroupAddMembers( # _In_ LPCWSTR servername, # _In_ LPCWSTR groupname, # _In_ DWORD level, # _In_ LPBYTE buf, # _In_ DWORD totalentries - #); + # ); safe_attach_function :NetLocalGroupAddMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD - #NET_API_STATUS NetLocalGroupSetMembers( + # 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( + # 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( + # NET_API_STATUS NetUserGetInfo( # _In_ LPCWSTR servername, # _In_ LPCWSTR username, # _In_ DWORD level, # _Out_ LPBYTE *bufptr - #); + # ); safe_attach_function :NetUserGetInfo, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE ], :DWORD - #NET_API_STATUS NetApiBufferFree( + # NET_API_STATUS NetApiBufferFree( # _In_ LPVOID Buffer - #); + # ); safe_attach_function :NetApiBufferFree, [:LPVOID], :DWORD - #NET_API_STATUS NetUserSetInfo( + # NET_API_STATUS NetUserSetInfo( # _In_ LPCWSTR servername, # _In_ LPCWSTR username, # _In_ DWORD level, # _In_ LPBYTE buf, # _Out_ LPDWORD parm_err - #); + # ); safe_attach_function :NetUserSetInfo, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetUserDel( + # NET_API_STATUS NetUserDel( # _In_ LPCWSTR servername, # _In_ LPCWSTR username - #); + # ); safe_attach_function :NetUserDel, [:LPCWSTR, :LPCWSTR], :DWORD - #NET_API_STATUS NetUseDel( - #_In_ LMSTR UncServerName, - #_In_ LMSTR UseName, - #_In_ DWORD ForceCond - #); + # NET_API_STATUS NetUseDel( + # _In_ LMSTR UncServerName, + # _In_ LMSTR UseName, + # _In_ DWORD ForceCond + # ); safe_attach_function :NetUseDel, [:LMSTR, :LMSTR, :DWORD], :DWORD - #NET_API_STATUS NetUseGetInfo( - #_In_ LMSTR UncServerName, - #_In_ LMSTR UseName, - #_In_ DWORD Level, - #_Out_ LPBYTE *BufPtr - #); + # NET_API_STATUS NetUseGetInfo( + # _In_ LMSTR UncServerName, + # _In_ LMSTR UseName, + # _In_ DWORD Level, + # _Out_ LPBYTE *BufPtr + # ); safe_attach_function :NetUseGetInfo, [:LMSTR, :LMSTR, :DWORD, :pointer], :DWORD - #NET_API_STATUS NetUseAdd( - #_In_ LMSTR UncServerName, - #_In_ DWORD Level, - #_In_ LPBYTE Buf, - #_Out_ LPDWORD ParmError - #); + # NET_API_STATUS NetUseAdd( + # _In_ LMSTR UncServerName, + # _In_ DWORD Level, + # _In_ LPBYTE Buf, + # _Out_ LPDWORD ParmError + # ); safe_attach_function :NetUseAdd, [:LMSTR, :DWORD, :LPBYTE, :LPDWORD], :DWORD end end diff --git a/lib/chef/win32/security/securable_object.rb b/lib/chef/win32/security/securable_object.rb index 16841413b7..f0bbfc7354 100644 --- a/lib/chef/win32/security/securable_object.rb +++ b/lib/chef/win32/security/securable_object.rb @@ -42,10 +42,10 @@ class Chef # compare an existing ACE with one you want to create. def predict_rights_mask(generic_mask) mask = generic_mask - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_READ if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_WRITE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_EXECUTE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_ALL if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_ALL) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_READ if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_WRITE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_EXECUTE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_ALL if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_ALL) != 0 if type == :SE_FILE_OBJECT mask |= Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ if (mask & Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 mask |= Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE if (mask & Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 -- cgit v1.2.1