diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index 19eecfded14..e601191c5de 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -218,6 +218,7 @@ static unsigned int dns_get_record_size( const ns_rr *rr ) break; } case ns_t_null: + case ns_t_opt: { size += rr->rdlength - 1; break; @@ -313,6 +314,15 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W *dlen = sizeof(DNS_NULL_DATA) + rr->rdlength - 1; break; } + case ns_t_opt: + { + r->Data.OPT.wDataLength = rr->rdlength; + r->Data.OPT.wPad = 0; + memcpy( r->Data.OPT.Data, rr->rdata, rr->rdlength ); + + *dlen = sizeof(DNS_OPT_DATA) + rr->rdlength - 1; + break; + } case ns_t_cname: case ns_t_ns: case ns_t_mb: diff --git a/dlls/dnsapi/record.c b/dlls/dnsapi/record.c index 7882b2290fc..8d7b17af645 100644 --- a/dlls/dnsapi/record.c +++ b/dlls/dnsapi/record.c @@ -222,6 +222,16 @@ BOOL WINAPI DnsRecordCompare( PDNS_RECORD r1, PDNS_RECORD r2 ) return FALSE; break; } + case DNS_TYPE_OPT: + { + if (r1->Data.Opt.wDataLength != r2->Data.Opt.wDataLength) + return FALSE; + /* ignore wPad */ + if (memcmp( r1->Data.Opt.Data, + r2->Data.Opt.Data, r1->Data.Opt.wDataLength )) + return FALSE; + break; + } case DNS_TYPE_AAAA: { for (i = 0; i < sizeof(IP6_ADDRESS)/sizeof(DWORD); i++) diff --git a/include/windns.h b/include/windns.h index f150919b423..d9a4b9adb07 100644 --- a/include/windns.h +++ b/include/windns.h @@ -519,6 +519,14 @@ typedef struct DECL_WINELIB_TYPE_AW(DNS_WINSR_DATA) DECL_WINELIB_TYPE_AW(PDNS_WINSR_DATA) +typedef struct +{ + WORD wDataLength; + WORD wPad; + BYTE Data[1]; +} +DNS_OPT_DATA, *PDNS_OPT_DATA; + typedef struct _DnsRecordA { struct _DnsRecordA *pNext; @@ -552,6 +560,7 @@ typedef struct _DnsRecordA DNS_TSIG_DATAA TSIG, Tsig; DNS_WINS_DATA WINS, Wins; DNS_WINSR_DATAA WINSR, WinsR, NBSTAT, Nbstat; + DNS_OPT_DATA OPT, Opt; } Data; } DNS_RECORDA, *PDNS_RECORDA; @@ -588,6 +597,7 @@ typedef struct _DnsRecordW DNS_TSIG_DATAW TSIG, Tsig; DNS_WINS_DATA WINS, Wins; DNS_WINSR_DATAW WINSR, WinsR, NBSTAT, Nbstat; + DNS_OPT_DATA OPT, Opt; } Data; } DNS_RECORDW, *PDNS_RECORDW;