none
MS-DNSP RRS feed

  • Question

  • Hi,

    I have looked only at a small part of this document with the date
    [MS-DNSP] – v20080313
    Domain Name Service (DNS) Server Management Protocol Specification

    and have found some small issues.

    1, the idl specification in chapter 6 : Appendix A: Full IDL
    DNS_STATUS
    R_DnssrvEnumRecords2(
        [in]                               DWORD   dwClientVersion,
        [in]                               DWORD   dwSettingFlags,
        [in, unique, string]               LPCWSTR pwszServerName,
        [in, unique, string]               LPCSTR  pszZone,
        [in, unique, string]               LPCSTR  pszNodeName,
        [in, unique, string]               LPCSTR  pszStartChild,
        [in]                               WORD    wRecordType,
        [in]                               DWORD   fSelectFlag,
        [in, unique, string]               LPCSTR  pszFilterStart,
        [in, unique, string]               LPCSTR  pszFilterStop,
        [out]                              PDWORD  pdwBufferLength,
        [out, size_is(, *pdwBufferLength)] PBYTE * ppBuffer
        );

    I think the last entry :
        [out, size_is(, *pdwBufferLength)] PBYTE * ppBuffer
    is a typo? and should be
        [out, size_is(pdwBufferLength)] PBYTE * ppBuffer
    The comma ',' in the IDL looks wrong.


    2,
    This interface specifies pointer default to be UNIQUE pointers :
    [
        uuid(50abc2a4-574d-40b3-9d66-ee4fd5fba076),
        version(5.0),
        pointer_default(unique)
    ]
    interface   DnsServer

    However, when I look at network traces of for example the procedure Query2, the two out parameters are supposedly pointers but do not specify an explicit pointer type and
    therefore should then be UNIQUE pointers :
          [out]                                PDWORD                 pdwTypeOut,
          [out, switch_is(*pdwTypeOut)]        DNSSRV_RPC_UNION *     ppDataOut

    However in my traces I have taken these two elements do not have a 4 byte pointer referral in the wire representation of these packets which makes me belive they are really REF pointers, since top-level REF pointers are not represented in the wire representation of the serialization of the PDU   but UNIQUE (and FULL) pointers are :
          [out,ref]                                PDWORD                 pdwTypeOut,
          [out,ref, switch_is(*pdwTypeOut)]        DNSSRV_RPC_UNION *     ppDataOut
    i.e. REF pointers and not UNIQUE pointers.

    I have so far only looked at this particular command so far so if this is an actual document bug, it may be present for the out parameters for other procedures in this interface as well.


    This request is in no way urgent and I do not require any immediate solution or correction to this issue in the document.
    Priority of this issue is low. Feel free to address,respond or tell me i have misread the idl at your convenience.

    ronnie sahlberg


    Saturday, April 19, 2008 7:24 PM

Answers

  •  

    Hi Ronnie, Thanks for your post regarding verification of the protocol specifications. With regard to your first question, the following link (http://msdn.microsoft.com/en-us/library/aa367164(VS.85).aspx ) to the MIDL language reference describes how the size_is attribute is applied and the rules surrounding its usage. In the example code you will notice the example for Proc7:

     

    HRESULT Proc7(

         [out] long  * pSize,

         [out, size_is( , *pSize)] my_type ** ppMyType);

     

    The comments next to this code state “Specifies a pointer to a sized pointer, which points to a block of my_types, whose size is unknown when the stub calls the server.” Hope this clarifies the MIDL usage in the protocol documentation.

     

    Thanks for taking the time to review our documentation and we hope this answers your first question.

    • Proposed as answer by KeithHa Wednesday, June 25, 2008 5:53 PM
    Friday, May 30, 2008 3:17 PM
  •  

    Hi Ronnie, Thanks for your post regarding verification of the protocol specifications. With regard to your second question, the following link ( http://msdn.microsoft.com/en-us/library/aa367294(VS.85).aspx ) to the MIDL language reference describes how the unique attribute is applied and the rules surrounding its usage. In the remarks section you will notice the statement:

     

    By default, top-level pointers in parameter lists are [ref] pointers. This is true even if the interface specifies pointer_default(unique). Top-level parameters in parameter lists must be specified with the [unique] attribute to be a unique pointer.

    Based on this remark, the pointer_default(unique) attribute is not applied to the top level parameters you point out in your example using R_DnssrvQuery2 parameter list because the two out parameters in question do not have the unique attribute specified.  They are ref by default.

     

    Thanks for taking the time to review our documentation and we hope this answers your second question.

    • Proposed as answer by KeithHa Wednesday, June 25, 2008 5:53 PM
    Friday, May 30, 2008 3:17 PM

All replies

  • Hi Ronnie, thanks for your post regarding the [MS-DNSP] : Domain Name Service (DNS) Server Management Protocol Specification. We will review your questions and update the forum once our investigation is complete. Thanks!

     

    Will Gregg - MSFT

     

    Tuesday, April 22, 2008 6:11 PM
  •  

    Hi Ronnie, Thanks for your post regarding verification of the protocol specifications. With regard to your first question, the following link (http://msdn.microsoft.com/en-us/library/aa367164(VS.85).aspx ) to the MIDL language reference describes how the size_is attribute is applied and the rules surrounding its usage. In the example code you will notice the example for Proc7:

     

    HRESULT Proc7(

         [out] long  * pSize,

         [out, size_is( , *pSize)] my_type ** ppMyType);

     

    The comments next to this code state “Specifies a pointer to a sized pointer, which points to a block of my_types, whose size is unknown when the stub calls the server.” Hope this clarifies the MIDL usage in the protocol documentation.

     

    Thanks for taking the time to review our documentation and we hope this answers your first question.

    • Proposed as answer by KeithHa Wednesday, June 25, 2008 5:53 PM
    Friday, May 30, 2008 3:17 PM
  •  

    Hi Ronnie, Thanks for your post regarding verification of the protocol specifications. With regard to your second question, the following link ( http://msdn.microsoft.com/en-us/library/aa367294(VS.85).aspx ) to the MIDL language reference describes how the unique attribute is applied and the rules surrounding its usage. In the remarks section you will notice the statement:

     

    By default, top-level pointers in parameter lists are [ref] pointers. This is true even if the interface specifies pointer_default(unique). Top-level parameters in parameter lists must be specified with the [unique] attribute to be a unique pointer.

    Based on this remark, the pointer_default(unique) attribute is not applied to the top level parameters you point out in your example using R_DnssrvQuery2 parameter list because the two out parameters in question do not have the unique attribute specified.  They are ref by default.

     

    Thanks for taking the time to review our documentation and we hope this answers your second question.

    • Proposed as answer by KeithHa Wednesday, June 25, 2008 5:53 PM
    Friday, May 30, 2008 3:17 PM