The name of the computer :type: :class:`str`
(self)
| 160 | #TODO: use GetComputerNameExA ? and recover other names ? |
| 161 | @utils.fixedpropety |
| 162 | def computer_name(self): |
| 163 | """The name of the computer |
| 164 | |
| 165 | :type: :class:`str` |
| 166 | """ |
| 167 | size = gdef.DWORD(0x1000) |
| 168 | # For now I don't know what is best as A vs W APIs... |
| 169 | if windows.pycompat.is_py3: |
| 170 | buf = ctypes.create_unicode_buffer(size.value) |
| 171 | winproxy.GetComputerNameW(buf, ctypes.byref(size)) |
| 172 | else: |
| 173 | buf = ctypes.create_string_buffer(size.value) |
| 174 | winproxy.GetComputerNameA(buf, ctypes.byref(size)) |
| 175 | return buf[:size.value] |
| 176 | |
| 177 | def _computer_name_ex(self, nametype): |
| 178 | size = gdef.DWORD(0) |
nothing calls this directly
no outgoing calls
no test coverage detected