Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
darpub.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 3k
Category:
Windows Kernel
Development Platform:
Visual C++
- #include "priv.h"
- // Do not build this file if on Win9X or NT4
- #ifndef DOWNLEVEL_PLATFORM
- #include "darpub.h"
- #include "darenum.h"
- #include "sccls.h"
- #include "util.h"
- /////////////////////////////////////////////////////////////////////////////
- // CDarwinAppPublisher
- // Very thin layer around the darwin CoGet* API's
- // constructor
- CDarwinAppPublisher::CDarwinAppPublisher() : _cRef(1)
- {
- DllAddRef();
- TraceAddRef(CDarwinAppPub, _cRef);
- }
- // destructor
- CDarwinAppPublisher::~CDarwinAppPublisher()
- {
- DllRelease();
- }
- // IAppPublisher::QueryInterface
- HRESULT CDarwinAppPublisher::QueryInterface(REFIID riid, LPVOID * ppvOut)
- {
- static const QITAB qit[] = {
- QITABENT(CDarwinAppPublisher, IAppPublisher), // IID_IAppPublisher
- { 0 },
- };
- return QISearch(this, qit, riid, ppvOut);
- }
- // IAppPublisher::AddRef
- ULONG CDarwinAppPublisher::AddRef()
- {
- _cRef++;
- TraceAddRef(CDarwinAppPub, _cRef);
- return _cRef;
- }
- // IAppPublisher::Release
- ULONG CDarwinAppPublisher::Release()
- {
- _cRef--;
- TraceRelease(CDarwinAppPub, _cRef);
- if (_cRef > 0)
- return _cRef;
- delete this;
- return 0;
- }
- // IAppPublisher::GetNumberOfCategories
- STDMETHODIMP CDarwinAppPublisher::GetNumberOfCategories(DWORD * pdwCat)
- {
- return E_NOTIMPL;
- }
- // IAppPublisher::GetCategories
- STDMETHODIMP CDarwinAppPublisher::GetCategories(APPCATEGORYINFOLIST * pAppCategoryList)
- {
- HRESULT hres = E_FAIL;
- RIP(pAppCategoryList);
- ZeroMemory(pAppCategoryList, SIZEOF(APPCATEGORYINFOLIST));
- APPCATEGORYINFOLIST acil = {0};
- hres = CsGetAppCategories(&acil);
- if (SUCCEEDED(hres) && (acil.cCategory > 0))
- {
- hres = _DuplicateCategoryList(&acil, pAppCategoryList);
- ReleaseAppCategoryInfoList(&acil);
- }
- return hres;
- }
- // IAppPublisher::GetNumberOfApps
- STDMETHODIMP CDarwinAppPublisher::GetNumberOfApps(DWORD * pdwApps)
- {
- return E_NOTIMPL;
- }
- // IAppPublisher::EnumApps
- STDMETHODIMP CDarwinAppPublisher::EnumApps(GUID * pAppCategoryId, IEnumPublishedApps ** ppepa)
- {
- HRESULT hres = E_FAIL;
- CDarwinEnumPublishedApps * pdepa = new CDarwinEnumPublishedApps(pAppCategoryId);
- if (pdepa)
- {
- *ppepa = SAFECAST(pdepa, IEnumPublishedApps *);
- hres = S_OK;
- }
- else
- hres = E_OUTOFMEMORY;
- return hres;
- }
- /*----------------------------------------------------------
- Purpose: Create-instance function for class factory
- */
- STDAPI CDarwinAppPublisher_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi)
- {
- // aggregation checking is handled in class factory
- HRESULT hres = E_OUTOFMEMORY;
- CDarwinAppPublisher* pObj = new CDarwinAppPublisher();
- if (pObj)
- {
- *ppunk = SAFECAST(pObj, IAppPublisher *);
- hres = S_OK;
- }
- return hres;
- }
- #endif //DOWNLEVEL_PLATFORM