[ uuid (2F5F3220-C126-1076-B549-074D078619DA),
  version (1.2),
  pointer_default(unique)]
interface nddeapi
{

unsigned long
wwNDdeShareAddW (
    [in] unsigned long nLevel,                  /* info level */
    [in, size_is(cBufSize), length_is(cBufSize)]
        byte *lpBuffer,                         /* cont struct, data */
    [in] unsigned long cBufSize,                /* sizeof buffer */

    [in, size_is(snl), length_is(snl)] byte * psn,
    [in] unsigned long snl,
    [in, size_is(atl), length_is(atl)] byte * pat,
    [in] unsigned long atl,
    [in, unique, size_is(sdl)] byte * psd,
    [in] unsigned long sdl,
    [in, size_is(itl), length_is(itl)] byte * pit,
    [in] unsigned long itl
);

/*
    Delete a Share
*/

unsigned long
wwNDdeShareDelA (
    [in, string, ref] unsigned char * lpszShareName, /* name of share */
    [in] unsigned long wReserved                     /* force level */
);

unsigned long
wwNDdeShareDelW (
    [in, string, ref] wchar_t * lpszShareName,  /* name of share */
    [in] unsigned long wReserved                /* force level */
);

/*
    Get Share Security Descriptor
*/

unsigned long
wwNDdeGetShareSecurityA(
    [in, string, ref] unsigned char * lpszShareName,    // name of share
    [in] unsigned long  si,                     // security info
    [in, out, unique, size_is(cbsd)]
                    byte *  psd,                // pointer to sd buffer
    [in] unsigned long      cbsd,               // size of buffer for security descriptor
    [in] unsigned long      bRemoteCall,        /* RPC client call */
                                                /* Can't RPC to self! */
    [out] unsigned long *   lpcbsdRequired,     // num bytes available
    [out] unsigned long *   lpnSizeToReturn
);

unsigned long
wwNDdeGetShareSecurityW(
    [in, string, ref] wchar_t * lpszShareName,  // name of share
    [in] unsigned long  si,                     // security info
    [in, out, unique, size_is(cbsd)]
                    byte *  psd,                // pointer to sd buffer
    [in] unsigned long      cbsd,               // size of buffer for security descriptor
    [in] unsigned long      bRemoteCall,        /* RPC client call */
                                                /* Can't RPC to self! */
    [out] unsigned long *   lpcbsdRequired,     // num bytes available
    [out] unsigned long *   lpnSizeToReturn
);

/*
    Set Share Security Descriptor
*/

unsigned long
wwNDdeSetShareSecurityA(
    [in, string, ref] unsigned char * lpszShareName,// name of share
    [in] unsigned long  si,                         // security info
    [in, size_is(sdl), length_is(sdl)] byte * psd,  // security descriptor
    [in] unsigned long sdl                          // and length
);

unsigned long
wwNDdeSetShareSecurityW(
    [in, string, ref] wchar_t * lpszShareName,      // name of share
    [in] unsigned long si,                          // security info
    [in, size_is(sdl), length_is(sdl)] byte * psd,  // security descriptor
    [in] unsigned long sdl                          // and length
);

/*
    Enumerate DDE Shares
*/
unsigned long
wwNDdeShareEnumA (
    [in] unsigned long nLevel,                  /* 0 (0 sep, 00 term) */
    [in, out, unique, size_is(cBufSize)]
        byte *lpBuffer,                         /* pointer to buffer */
    [in] unsigned long cBufSize,                /* size of buffer */
    [out] unsigned long *lpnEntriesRead,        /* num names returned */
    [out] unsigned long *lpcbTotalAvailable,    /* num bytes available */
    [out] unsigned long *lpnSizeToReturn
);

unsigned long
wwNDdeShareEnumW (
    [in] unsigned long nLevel,                  /* 0 (0 sep, 00 term) */
    [in, out, unique, size_is(cBufSize)]
        byte *lpBuffer,                         /* pointer to buffer */
    [in] unsigned long cBufSize,                /* size of buffer */
    [out] unsigned long *lpnEntriesRead,        /* num names returned */
    [out] unsigned long *lpcbTotalAvailable,    /* num bytes available */
    [out] unsigned long *lpnSizeToReturn
);

/*
    Get DDE Share Info
*/

unsigned long
wwNDdeShareGetInfoW (
    [in, string, ref] wchar_t * lpszShareName,  /* name of share */
    [in] unsigned long nLevel,                  /* info level must be 2 */
    [in, out, unique, size_is(cBufSize) ]
        byte *lpBuffer,                         /* gets struct */
    [in] unsigned long cBufSize,                /* sizeof buffer */
    [out] unsigned long *lpnTotalAvailable,     /* num bytes available */
    [out] unsigned short *lpnItems,             /* item mask for partial */
                                                /* getinfo (must=0) */
    [in]  unsigned long  bRemoteCall,           /* RPC client call */
                                                /* Can't RPC to self! */
    [out] unsigned long *lpnSizeToReturn,

    [out] unsigned long *lpnSnOffset,
    [out] unsigned long *lpnAtOffset,
    [out] unsigned long *lpnItOffset
);

/*
    Set DDE Share Info
*/
unsigned long
wwNDdeShareSetInfoW (
    [in, string, ref] wchar_t *lpszShareName,   /* name of share */
    [in] unsigned long nLevel,                  /* info level must be 2 */
    [in, size_is(cBufSize), length_is(cBufSize)]
        byte *lpBuffer,                         /* must point to struct */
    [in] unsigned long cBufSize,                /* sizeof buffer */
    [in] unsigned short sParmNum,               /* Parameter index /*
                                                /* (must be 0 - entire) */
    [in, size_is(snl), length_is(snl)] byte * psn,
    [in] unsigned long snl,
    [in, size_is(atl), length_is(atl)] byte * pat,
    [in] unsigned long atl,
    [in, size_is(itl), length_is(itl)] byte * pit,
    [in] unsigned long itl
);

/*
    Set Trusted Share
*/

unsigned long
wwNDdeSetTrustedShareA(
    [in, string, ref] unsigned char * lpszShareName,// name of share
    [in] unsigned long  dwOptions                   // trust share options
);

unsigned long
wwNDdeSetTrustedShareW(
    [in, string, ref] wchar_t * lpszShareName,      // name of share
    [in] unsigned long dwOptions                    // trust share options
);

/*
    Get Trusted Share Options
*/

unsigned long
wwNDdeGetTrustedShareA(
    [in, string, ref] unsigned char * lpszShareName,// name of share
    [out] unsigned long *   lpdwOptions,            // ptr to trust share opt
    [out] unsigned long *   lpdwShareModId0,        // ptr to trust share opt
    [out] unsigned long *   lpdwShareModId1         // ptr to trust share opt
);

unsigned long
wwNDdeGetTrustedShareW(
    [in, string, ref] wchar_t * lpszShareName,      // name of share
    [out] unsigned long *   lpdwOptions,            // ptr to trust share opt
    [out] unsigned long *   lpdwShareModId0,        // ptr to trust share opt
    [out] unsigned long *   lpdwShareModId1         // ptr to trust share opt
);


/*
    Enumerate Trusted Shares
*/
unsigned long
wwNDdeTrustedShareEnumA (
    [in] unsigned long nLevel,                  /* 0 (0 sep, 00 term) */
    [in, out, unique, size_is(cBufSize)]
        byte *lpBuffer,                         /* pointer to buffer */
    [in] unsigned long cBufSize,                /* size of buffer */
    [out] unsigned long *lpnEntriesRead,        /* num names returned */
    [out] unsigned long *lpcbTotalAvailable,    /* num bytes available */
    [out] unsigned long *lpnSizeToReturn
);

unsigned long
wwNDdeTrustedShareEnumW (
    [in] unsigned long nLevel,                  /* 0 (0 sep, 00 term) */
    [in, out, unique, size_is(cBufSize)]
        byte *lpBuffer,                         /* pointer to buffer */
    [in] unsigned long cBufSize,                /* size of buffer */
    [out] unsigned long *lpnEntriesRead,        /* num names returned */
    [out] unsigned long *lpcbTotalAvailable,    /* num bytes available */
    [out] unsigned long *lpnSizeToReturn
);


unsigned long
wwNDdeSpecialCommand (
    [in] unsigned long command,
    [in, out, unique, size_is(nBytesDataIn)] byte *lpDataIn,
    [in] unsigned long nBytesDataIn,
    [in, out, unique, size_is(*nOutBufSize)] byte *lpDataOut,
    [in, out] unsigned long *nOutBufSize
);

}

