MCPcopy Create free account
hub / github.com/mhammond/pywin32 / GetFileTime

Method GetFileTime

com/win32comext/shell/src/PyIShellItem2.cpp:216–235  ·  view source on GitHub ↗

@pymethod |PyIShellItem2|GetFileTime|Retrieves the value of a property as a FILETIME

Source from the content-addressed store, hash-verified

214
215// @pymethod <o PyTime>|PyIShellItem2|GetFileTime|Retrieves the value of a property as a FILETIME
216PyObject *PyIShellItem2::GetFileTime(PyObject *self, PyObject *args)
217{
218 IShellItem2 *pISI2 = GetI(self);
219 if ( pISI2 == NULL )
220 return NULL;
221
222 FILETIME val;
223 PROPERTYKEY key;
224 // @pyparm <o PyPROPERTYKEY>|key||The id of the property to retrieve
225 if (!PyArg_ParseTuple(args, "O&:GetFileTime", PyObject_AsSHCOLUMNID, &key))
226 return NULL;
227 HRESULT hr;
228 PY_INTERFACE_PRECALL;
229 hr = pISI2->GetFileTime(key, &val);
230 PY_INTERFACE_POSTCALL;
231
232 if ( FAILED(hr) )
233 return PyCom_BuildPyException(hr, pISI2, IID_IShellItem2 );
234 return PyWinObject_FromFILETIME(val);
235}
236
237// @pymethod int|PyIShellItem2|GetInt32|Retrieves the value of a property as a 32 bit int.
238PyObject *PyIShellItem2::GetInt32(PyObject *self, PyObject *args)

Callers 2

testFileTimesMethod · 0.80

Calls 5

FAILEDFunction · 0.85
PyCom_BuildPyExceptionFunction · 0.85
PyWinObject_FromFILETIMEFunction · 0.85
PyObject_FromSHCOLUMNIDFunction · 0.85
PyWinObject_AsFILETIMEFunction · 0.85

Tested by 2

testFileTimesMethod · 0.64