// @pymethod str|PyIShellLibrary|GetIcon|Returns the location of the library's icon // @rdesc Uses "module,resource" format PyObject *PyIShellLibrary::GetIcon(PyObject *self, PyObject *args) { IShellLibrary *pISL = GetI(self); if ( pISL == NULL ) return NULL; LPWSTR Icon; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISL->GetIcon(&Icon); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISL, IID_IShellLibrary ); PyObject *ret = PyWinObject_FromWCHAR(Icon); CoTaskMemFree(Icon); // Docs don't specify, but this doesn't leak return ret; }