HomeServer.idl

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

You will need to use the HomeServer.idl file in order to register the HomeServer.dll file on your development computer. To create the HomeServer.idl file, copy the code under the Example section to a text file and then rename the file HomeServer.idl.

Example

// ==++==
// 
//   Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// ==--==

cpp_quote("//+-------------------------------------------------------------------------")
cpp_quote("//")
cpp_quote("//  Microsoft Windows")
cpp_quote("//  Copyright (c) Microsoft Corporation. All rights reserved.")
cpp_quote("//")
cpp_quote("//--------------------------------------------------------------------------")
cpp_quote("#if ( _MSC_VER >= 1020 )")
cpp_quote("#pragma once")
cpp_quote("#endif")

import "oaidl.idl";
import "ocidl.idl";

midl_pragma warning( disable: 2456 ) 

enum WHS_Notification_Severity 
{
    WHS_INVALID = 0x0,
    WHS_INFO    = 0x1,
    WHS_WARNING = 0x2,
    WHS_ERROR   = 0x3
};

enum WHS_Notification_Type
{
    WHS_NOTIFICATION_INVALID = 0x0,
    WHS_NOTIFICATION_ADD     = 0x1,
    WHS_NOTIFICATION_REMOVE  = 0x2
};

enum WHSBackupState 
{
    WHS_BACKUP_IDLE = 0x0,
    WHS_BACKUP_BACKUP = 0x1,
    WHS_BACKUP_RESTORE = 0x2,
    WHS_BACKUP_CLEANUP = 0x3,
    WHS_BACKUP_UNKNOWN = 0xFF
};

enum WHSDiskStatus
{
    WHS_DISK_INITIALIZED = 0,     // The object has been instantiated but not physically created
    WHS_DISK_HEALTHY     = 1,     // The object is healthy
    WHS_DISK_FAILING     = 2,     // The object lost reliability
    WHS_DISK_FAILED      = 3,     // The object has failed
    WHS_DISK_MISSING     = 4,     // The object disappeared
    WHS_DISK_UNKNOWN     = 5     // The disk or volume is new to the system
};


interface IComputerInfo;
interface IShareInfo;
interface IWHSInfo;
interface IDiskInfo;
interface IVolumeInfo;
interface IApplicationFolder;

[object, oleautomation, uuid(F13E2751-699E-40b6-95C5-22FD25C4B515) ]
interface IComputerInfo : IUnknown
{
    [propget, helpstring("method get_Name")]
    HRESULT ComputerName( [out, retval] BSTR* pName);

    [propget, helpstring("method get_IsOnline")]
    HRESULT IsOnline( [out, retval] BOOL* pIsOnline);
    
    [propget, helpstring("method get_Description")]
    HRESULT Description( [out, retval] BSTR* pDescription);

    [propget, helpstring("method get OS Major Number")]
    HRESULT OSMajorNumber( [out, retval] DWORD* pdwOSMajorNumber);

    [propget, helpstring("method get OS Minor Number")]
    HRESULT OSMinorNumber( [out, retval] DWORD* pdwOSMajorNumber);

    [propget, helpstring("method get_IPAddress")]
    HRESULT IPAddress( [out, retval] BSTR* pIPAddress);
}

[object, oleautomation, uuid(26DE4058-B904-4bf4-9402-2688A6BEBACF) ]
interface IShareInfo : IUnknown
{
    [propget, helpstring("method get_Name")]
    HRESULT Name( [out, retval] BSTR* pName);

    [propget, helpstring("method get_Description")]
    HRESULT Description( [out, retval] BSTR* pDescription);

    [propget, helpstring("method get_Path")]
    HRESULT Path( [out, retval] BSTR* pPath);

    [propget, helpstring("method get_IsDuplicated")]
    HRESULT IsDuplicated( [out, retval] BOOL* pIsDuplicated);

    [propget, helpstring("method get_MediaConnect")]
    HRESULT MediaConnectEnabled( [out, retval] BOOL* pMediaConnectEnabled);
}

[object, oleautomation, uuid(BF5D924B-F617-409a-95C9-95DEFDE0040D) ]
interface IDiskInfo : IUnknown
{
    [propget, helpstring("method get_SystemName")]
    HRESULT SystemName( [out, retval] BSTR* pName);

    [propget, helpstring("method get_DevicePath")]
    HRESULT DevicePath( [out, retval] BSTR* pPath);

    [propget, helpstring("method get_Size")]
    HRESULT Size([out, retval] hyper *pSize);

    [propget, helpstring("method get_DiskStatus")]
    HRESULT Status([out, retval] enum WHSDiskStatus *Status);
}

[object, oleautomation, uuid(7322CE9B-59F9-49e5-8511-5FDE5C8188A2) ]
interface IVolumeInfo : IUnknown
{
    [propget, helpstring("method get_Path")]
    HRESULT Path( [out, retval] BSTR* pPath);

    [propget, helpstring("method get_UsedSpace")]
    HRESULT UsedSpace([out, retval] hyper *pSize);

    [propget, helpstring("method get_Size")]
    HRESULT Size([out, retval] hyper *pSize);
}

[object, oleautomation, uuid(FA458F44-DD4A-477e-8868-E4F49926B162) ]
interface IApplicationFolder : IUnknown
{
    [propget, helpstring("method get_Name")]
    HRESULT Name( [out, retval] GUID *pName);

    [propget, helpstring("method get_FriendlyName")]
    HRESULT FriendlyName( [out, retval] BSTR *pFriendlyName);

    [propget, helpstring("method get_Path")]
    HRESULT Path( [out, retval] BSTR* pPath);
    
    [propget, helpstring("method get_IsDuplicated")]
    HRESULT IsDuplicated( [out, retval] BOOL* pIsDuplicated);

    [propput, helpstring("method put_IsDuplicated")]
    HRESULT IsDuplicated( [in] BOOL IsDuplicated);
}


[object, oleautomation, uuid(DBAC857E-3681-4c32-9743-6DFC30ED6C76) ]
interface INotificationCallback : IUnknown
{
    [helpstring("method Notification Changed")]
    HRESULT NotificationChanged([in] BSTR UniqueID, [in] enum WHS_Notification_Type Type, [in] enum WHS_Notification_Severity Severity, [in] BSTR textHeader, [in] BSTR textDescription);

    [helpstring("method PhysicalDiskChanged")]
    HRESULT PhysicalDiskChanged(IDiskInfo *pDiskInfo);

    [helpstring("method BackupStateChanged")]
    HRESULT BackupStateChanged(enum WHSBackupState State);

    [helpstring("method Disconnected called when the connection to the Home Server Connector has been broken")]
    HRESULT Disconnected();

    [helpstring("method Reconnected called when the connection to the Home Server Connector has been reconnected after a disconnect")]
    HRESULT ReConnected();
}

[object, oleautomation, uuid(0D71BFB4-A870-49ab-9F98-9B3EE1557774) ]
interface IWHSInfo : IUnknown
{   
    // Init methods - Application Name is used in notifications to 
    //   identify the caller of this SDK for event removal in case
    //   of caller failure
    HRESULT Init([in] BSTR ApplicationName);

    // Application Folders
    HRESULT GetApplicationFolder([in] GUID UniqueID, [out, retval] IApplicationFolder **ppFolder);
    HRESULT GetApplicationFolders([out, retval] SAFEARRAY(IApplicationFolder*) *psaFolders);
    HRESULT RemoveApplicationFolder([in] GUID UniqueID);
    HRESULT CreateApplicationFolder([in] GUID UniqueID, [in] BSTR FriendlyName, [out, retval] IApplicationFolder **ppFolder);

    // Client Computers
    HRESULT GetClientComputerInfo  ([out, retval] SAFEARRAY(IComputerInfo*) *psaComputers);  
    
    // Share information
    HRESULT GetShareInfo ([out, retval] SAFEARRAY(IShareInfo*) *psaShares);
    
    // Managed Volume Information
    HRESULT GetVolumeInfo ([out, retval] SAFEARRAY(IVolumeInfo*) *psaVolumes);

    // Managed Disk Information
    HRESULT GetDiskInfo ([out, retval] SAFEARRAY(IDiskInfo*) *psaDisks);

    // Notifications
    HRESULT AddNotification([in] BSTR UniqueID, [in] enum WHS_Notification_Severity State, [in] BSTR textHeader, [in] BSTR textDescription); 
    HRESULT RemoveNotification([in] BSTR UniqueID);
    HRESULT RegisterForNotifications([in] INotificationCallback *pCallBack);
    HRESULT UnRegisterForNotifications();

    // Backup Information
    HRESULT GetBackupStartTime([out, retval] DWORD *MinutesFromMidnight);            
    HRESULT GetBackupEstimatedCompletionTime([out, retval] DWORD *MinutesFromMidnight);    
    HRESULT GetBackupState([out, retval] enum WHSBackupState *pState);
}

[uuid(FFC3A32E-4D40-410b-AC2A-99799A6ACC6E), version(1.0)]
library WHSInfoIF
{
    interface IComputerInfo;
    interface IShareInfo;  
    interface IApplicationFolder;    
    interface IDiskInfo;
    interface IVolumeInfo;

    enum WHSBackupState;
    enum WHS_Notification_Severity;

    [uuid(99BDE280-300D-4016-9382-F86E16AA0DBB) ]
    coclass WHSInfo
    {
       interface IWHSInfo;
    }
}