Lines Matching defs:record

280     \param record     EMF record that contains a DIB pixel array
282 \param offBmi offset from the start of the record to the start of the bitmapinfo structure
283 \param cbBmi declared space for the bitmapinfo structure in the record
284 \param offBits offset from the start of the record to the start of the bitmap
285 \param cbBits declared space for the bitmap in the record (amount used may be less than this)
286 \param blimit one byte past the end of the record.
293 const char *record,
308 if(!cbBmi)return(1); // No DIB in a record where it is optional
309 if(IS_MEM_UNSAFE(record, offBmi + cbBmi, blimit))return(0);
310 if(cbBits && IS_MEM_UNSAFE(record, offBits + cbBits, blimit))return(0);
315 dibparams = get_DIB_params(record, offBits, offBmi, &px, (const U_RGBQUAD **) &ct,
318 bitmapinfo_swap(record + offBmi); // byte ordered fields in bitmapinfo
320 dibparams = get_DIB_params(record, offBits, offBmi, &px, (const U_RGBQUAD **) &ct,
337 if(IS_MEM_UNSAFE(record+offBits, usedbytes, blimit))return(0);
341 bitmapinfo_swap(record + offBmi);
349 \param blimit one byte past the end of the record
455 \brief Convert a Pointer to a U_EMRTEXT record
456 \param pemt Pointer to a U_EMRTEXT record
457 \param record Pointer to the start of the record which contains this U_EMRTEXT
458 \param blimit one byte past the end of the record.
463 char *record,
496 if(IS_MEM_UNSAFE(record, count*4, blimit))return(0);
497 U_swap4((record + offDx),count); // Dx[], offset with respect to the Record, NOT the object
510 void core1_swap(char *record, int torev){
520 int core5_swap(char *record, int torev){
522 if(!record)return(0);
523 PU_EMR pEmr = (PU_EMR)(record);
529 int core1_swap(char *record, int torev){
532 PU_EMRPOLYLINETO pEmr = (PU_EMRPOLYLINETO) (record);
535 blimit = record + pEmr->emr.nSize;
537 if(!core5_swap(record, torev))return(0);
542 blimit = record + pEmr->emr.nSize;
550 int core2_swap(char *record, int torev){
554 PU_EMRPOLYPOLYLINE pEmr = (PU_EMRPOLYPOLYLINE) (record);
558 blimit = record + pEmr->emr.nSize;
560 if(!core5_swap(record, torev))return(0);
566 blimit = record + pEmr->emr.nSize;
570 record += sizeof(U_EMRPOLYPOLYLINE) - 4 + sizeof(uint32_t)* nPolys;
571 if(IS_MEM_UNSAFE(record, count*sizeof(U_POINTL), blimit))return(0);
572 pointl_swap((PU_POINT)(record), count); // paptl[]
578 int core3_swap(char *record, int torev){
579 PU_EMRSETMAPMODE pEmr = (PU_EMRSETMAPMODE)(record);
580 if(!core5_swap(record, torev))return(0);
586 int core4_swap(char *record, int torev){
587 PU_EMRELLIPSE pEmr = (PU_EMRELLIPSE)( record);
588 if(!core5_swap(record, torev))return(0);
594 int core6_swap(char *record, int torev){
597 PU_EMRPOLYBEZIER16 pEmr = (PU_EMRPOLYBEZIER16) (record);
600 blimit = record + pEmr->emr.nSize;
602 if(!core5_swap(record, torev))return(0);
607 blimit = record + pEmr->emr.nSize;
616 int core7_swap(char *record, int torev){
617 PU_EMRGENERICPAIR pEmr = (PU_EMRGENERICPAIR) (record);
618 if(!core5_swap(record, torev))return(0);
624 int core8_swap(char *record, int torev){
626 PU_EMREXTTEXTOUTA pEmr = (PU_EMREXTTEXTOUTA) (record);
628 blimit = record + pEmr->emr.nSize;
630 if(!core5_swap(record, torev))return(0);
635 blimit = record + pEmr->emr.nSize;
637 if(!emrtext_swap(&(pEmr->emrtext),record,blimit,torev))return(0);
642 int core9_swap(char *record, int torev){
643 PU_EMRARC pEmr = (PU_EMRARC) (record);
644 if(!core5_swap(record, torev))return(0);
651 int core10_swap(char *record, int torev){
655 PU_EMRPOLYPOLYLINE16 pEmr = (PU_EMRPOLYPOLYLINE16) (record);
659 blimit = record + pEmr->emr.nSize;
661 if(!core5_swap(record, torev))return(0);
667 blimit = record + pEmr->emr.nSize;
671 record += sizeof(U_EMRPOLYPOLYLINE16) - 4 + sizeof(uint32_t)* nPolys;
672 if(IS_MEM_UNSAFE(record, count*sizeof(U_POINT16), blimit))return(0);
673 point16_swap((PU_POINT16)(record), count); // apts[]
678 int core11_swap(char *record, int torev){
681 PU_EMRINVERTRGN pEmr = (PU_EMRINVERTRGN)(record);
684 blimit = record + pEmr->emr.nSize;
686 if(!core5_swap(record, torev))return(0);
691 blimit = record + pEmr->emr.nSize;
699 int core12_swap(char *record, int torev){
706 PU_EMRCREATEMONOBRUSH pEmr = (PU_EMRCREATEMONOBRUSH) (record);
713 blimit = record + pEmr->emr.nSize;
714 if(!DIB_swap(record, iUsage, offBmi, cbBmi, offBits, cbBits, blimit, torev))return(0);
716 if(!core5_swap(record, torev))return(0);
724 blimit = record + pEmr->emr.nSize;
725 if(!DIB_swap(record, iUsage, offBmi, cbBmi, offBits, cbBits, blimit, torev))return(0);
732 int core13_swap(char *record, int torev){
739 PU_EMRALPHABLEND pEmr = (PU_EMRALPHABLEND) (record);
746 blimit = record + pEmr->emr.nSize;
747 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
749 if(!core5_swap(record, torev))return(0);
764 blimit = record + pEmr->emr.nSize;
765 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
772 These are the core EMR_swap functions, each converts a particular type of record.
773 All operate in place on the chunk of memory holding that record.
775 the record. These cases return a status value of 0 if that happens, 1 on success. Other
781 All of the record level (hidden) functions have this form:
782 \brief Convert a pointer to a U_EMR_whatever record which has not been implemented.
783 \param record pointer to a buffer holding the EMR record
786 int U_EMRNOTIMPLEMENTED_swap(char *record, int torev){
787 fprintf(stderr,"EMF WARNING: could not swap data bytes on record because that type has not been implemented!\n");
788 return(core5_swap(record, torev));
792 int U_EMRHEADER_swap(char *record, int torev){
795 PU_EMRHEADER pEmr = (PU_EMRHEADER)(record);
801 if(!core5_swap(record, torev))return(0);
826 if(cbPix)pixelformatdescriptor_swap( (PU_PIXELFORMATDESCRIPTOR) (record + pEmr->offPixelFormat));
838 int U_EMRPOLYBEZIER_swap(char *record, int torev){
839 return(core1_swap(record, torev));
843 int U_EMRPOLYGON_swap(char *record, int torev){
844 return(core1_swap(record, torev));
849 int U_EMRPOLYLINE_swap(char *record, int torev){
850 return(core1_swap(record, torev));
854 int U_EMRPOLYBEZIERTO_swap(char *record, int torev){
855 return(core1_swap(record, torev));
859 int U_EMRPOLYLINETO_swap(char *record, int torev){
860 return(core1_swap(record, torev));
864 int U_EMRPOLYPOLYLINE_swap(char *record, int torev){
865 return(core2_swap(record, torev));
869 int U_EMRPOLYPOLYGON_swap(char *record, int torev){
870 return(core2_swap(record, torev));
874 int U_EMRSETWINDOWEXTEX_swap(char *record, int torev){
875 return(core7_swap(record, torev));
879 int U_EMRSETWINDOWORGEX_swap(char *record, int torev){
880 return(core7_swap(record, torev));
884 int U_EMRSETVIEWPORTEXTEX_swap(char *record, int torev){
885 return(core7_swap(record, torev));
889 int U_EMRSETVIEWPORTORGEX_swap(char *record, int torev){
890 return(core7_swap(record, torev));
894 int U_EMRSETBRUSHORGEX_swap(char *record, int torev){
895 return(core7_swap(record, torev));
899 int U_EMREOF_swap(char *record, int torev){
903 PU_EMREOF pEmr = (PU_EMREOF)(record);
905 blimit = record + pEmr->emr.nSize;
908 if(!core5_swap(record, torev))return(0);
911 blimit = record + pEmr->emr.nSize;
915 if(IS_MEM_UNSAFE(record, pEmr->offPalEntries + 2*2, blimit))return(0); // 2 16 bit values in U_LOGPALLETE
916 logpalette_swap( (PU_LOGPALETTE)(record + pEmr->offPalEntries));
920 if(IS_MEM_UNSAFE(record, off + 4, blimit))return(0);
921 U_swap4(record + off,1); // nSizeLast
927 int U_EMRSETPIXELV_swap(char *record, int torev){
928 if(!core5_swap(record, torev))return(0);
929 PU_EMRSETPIXELV pEmr = (PU_EMRSETPIXELV)(record);
937 int U_EMRSETMAPPERFLAGS_swap(char *record, int torev){
938 if(!core5_swap(record, torev))return(0);
939 PU_EMRSETMAPPERFLAGS pEmr = (PU_EMRSETMAPPERFLAGS)(record);
946 int U_EMRSETMAPMODE_swap(char *record, int torev){
947 return(core3_swap(record, torev));
951 int U_EMRSETBKMODE_swap(char *record, int torev){
952 return(core3_swap(record, torev));
956 int U_EMRSETPOLYFILLMODE_swap(char *record, int torev){
957 return(core3_swap(record, torev));
961 int U_EMRSETROP2_swap(char *record, int torev){
962 return(core3_swap(record, torev));
966 int U_EMRSETSTRETCHBLTMODE_swap(char *record, int torev){
967 return(core3_swap(record, torev));
971 int U_EMRSETTEXTALIGN_swap(char *record, int torev){
972 return(core3_swap(record, torev));
976 int U_EMRSETCOLORADJUSTMENT_swap(char *record, int torev){
977 if(!core5_swap(record, torev))return(0);
978 PU_EMRSETCOLORADJUSTMENT pEmr = (PU_EMRSETCOLORADJUSTMENT)(record);
984 int U_EMRSETTEXTCOLOR_swap(char *record, int torev){
985 if(!core5_swap(record, torev))return(0);
991 int U_EMRSETBKCOLOR_swap(char *record, int torev){
992 if(!core5_swap(record, torev))return(0);
998 int U_EMROFFSETCLIPRGN_swap(char *record, int torev){
999 return(core7_swap(record, torev));
1003 int U_EMRMOVETOEX_swap(char *record, int torev){
1004 return(core7_swap(record, torev));
1008 int U_EMRSETMETARGN_swap(char *record, int torev){
1009 return(core5_swap(record, torev));
1013 int U_EMREXCLUDECLIPRECT_swap(char *record, int torev){
1014 return(core4_swap(record, torev));
1018 int U_EMRINTERSECTCLIPRECT_swap(char *record, int torev){
1019 return(core4_swap(record, torev));
1023 int U_EMRSCALEVIEWPORTEXTEX_swap(char *record, int torev){
1024 return(core4_swap(record, torev));
1028 int U_EMRSCALEWINDOWEXTEX_swap(char *record, int torev){
1029 return(core4_swap(record, torev));
1033 int U_EMRSAVEDC_swap(char *record, int torev){
1034 return(core5_swap(record, torev));
1038 int U_EMRRESTOREDC_swap(char *record, int torev){
1039 return(core3_swap(record, torev));
1043 int U_EMRSETWORLDTRANSFORM_swap(char *record, int torev){
1044 if(!core5_swap(record, torev))return(0);
1045 PU_EMRSETWORLDTRANSFORM pEmr = (PU_EMRSETWORLDTRANSFORM)(record);
1051 int U_EMRMODIFYWORLDTRANSFORM_swap(char *record, int torev){
1052 if(!core5_swap(record, torev))return(0);
1053 PU_EMRMODIFYWORLDTRANSFORM pEmr = (PU_EMRMODIFYWORLDTRANSFORM)(record);
1060 int U_EMRSELECTOBJECT_swap(char *record, int torev){
1061 if(!core5_swap(record, torev))return(0);
1062 PU_EMRSELECTOBJECT pEmr = (PU_EMRSELECTOBJECT)(record);
1068 int U_EMRCREATEPEN_swap(char *record, int torev){
1069 if(!core5_swap(record, torev))return(0);
1070 PU_EMRCREATEPEN pEmr = (PU_EMRCREATEPEN)(record);
1077 int U_EMRCREATEBRUSHINDIRECT_swap(char *record, int torev){
1078 if(!core5_swap(record, torev))return(0);
1079 PU_EMRCREATEBRUSHINDIRECT pEmr = (PU_EMRCREATEBRUSHINDIRECT)(record);
1086 int U_EMRDELETEOBJECT_swap(char *record, int torev){
1087 if(!core5_swap(record, torev))return(0);
1088 PU_EMRDELETEOBJECT pEmr = (PU_EMRDELETEOBJECT)(record);
1094 int U_EMRANGLEARC_swap(char *record, int torev){
1095 if(!core5_swap(record, torev))return(0);
1096 PU_EMRANGLEARC pEmr = (PU_EMRANGLEARC)(record);
1103 int U_EMRELLIPSE_swap(char *record, int torev){
1104 return(core4_swap(record, torev));
1108 int U_EMRRECTANGLE_swap(char *record, int torev){
1109 return(core4_swap(record, torev));
1113 int U_EMRROUNDRECT_swap(char *record, int torev){
1114 if(!core5_swap(record, torev))return(0);
1115 PU_EMRROUNDRECT pEmr = (PU_EMRROUNDRECT)(record);
1122 int U_EMRARC_swap(char *record, int torev){
1123 return(core9_swap(record, torev));
1127 int U_EMRCHORD_swap(char *record, int torev){
1128 return(core9_swap(record, torev));
1132 int U_EMRPIE_swap(char *record, int torev){
1133 return(core9_swap(record, torev));
1137 int U_EMRSELECTPALETTE_swap(char *record, int torev){
1138 return(core3_swap(record, torev));
1142 int U_EMRCREATEPALETTE_swap(char *record, int torev){
1143 if(!core5_swap(record, torev))return(0);
1144 PU_EMRCREATEPALETTE pEmr = (PU_EMRCREATEPALETTE)(record);
1151 int U_EMRSETPALETTEENTRIES_swap(char *record, int torev){
1152 if(!core5_swap(record, torev))return(0);
1153 PU_EMRSETPALETTEENTRIES pEmr = (PU_EMRSETPALETTEENTRIES)(record);
1160 int U_EMRRESIZEPALETTE_swap(char *record, int torev){
1161 return(core7_swap(record, torev));
1165 int U_EMRREALIZEPALETTE_swap(char *record, int torev){
1166 return(core5_swap(record, torev));
1170 int U_EMREXTFLOODFILL_swap(char *record, int torev){
1171 if(!core5_swap(record, torev))return(0);
1172 PU_EMREXTFLOODFILL pEmr = (PU_EMREXTFLOODFILL)(record);
1180 int U_EMRLINETO_swap(char *record, int torev){
1181 return(core7_swap(record, torev));
1185 int U_EMRARCTO_swap(char *record, int torev){
1186 return(core9_swap(record, torev));
1190 int U_EMRPOLYDRAW_swap(char *record, int torev){
1193 PU_EMRPOLYDRAW pEmr = (PU_EMRPOLYDRAW)(record);
1197 blimit = record + pEmr->emr.nSize;
1199 if(!core5_swap(record, torev))return(0);
1204 blimit = record + pEmr->emr.nSize;
1213 int U_EMRSETARCDIRECTION_swap(char *record, int torev){
1214 return(core3_swap(record, torev));
1218 int U_EMRSETMITERLIMIT_swap(char *record, int torev){
1219 return(core3_swap(record, torev));
1224 int U_EMRBEGINPATH_swap(char *record, int torev){
1225 return(core5_swap(record, torev));
1229 int U_EMRENDPATH_swap(char *record, int torev){
1230 return(core5_swap(record, torev));
1234 int U_EMRCLOSEFIGURE_swap(char *record, int torev){
1235 return(core5_swap(record, torev));
1239 int U_EMRFILLPATH_swap(char *record, int torev){
1240 return(core4_swap(record, torev));
1244 int U_EMRSTROKEANDFILLPATH_swap(char *record, int torev){
1245 return(core4_swap(record, torev));
1249 int U_EMRSTROKEPATH_swap(char *record, int torev){
1250 return(core4_swap(record, torev));
1254 int U_EMRFLATTENPATH_swap(char *record, int torev){
1255 return(core5_swap(record, torev));
1259 int U_EMRWIDENPATH_swap(char *record, int torev){
1260 return(core5_swap(record, torev));
1264 int U_EMRSELECTCLIPPATH_swap(char *record, int torev){
1265 return(core3_swap(record, torev));
1269 int U_EMRABORTPATH_swap(char *record, int torev){
1270 return(core5_swap(record, torev));
1277 int U_EMRCOMMENT_swap(char *record, int torev){
1280 PU_EMRCOMMENT pEmr = (PU_EMRCOMMENT)(record);
1283 blimit = record + pEmr->emr.nSize;
1285 if(!core5_swap(record, torev))return(0);
1289 blimit = record + pEmr->emr.nSize;
1291 if(IS_MEM_UNSAFE(record, cbData + sizeof(U_SIZE_EMRCOMMENT), blimit))return(0);
1297 int U_EMRFILLRGN_swap(char *record, int torev){
1300 PU_EMRFILLRGN pEmr = (PU_EMRFILLRGN)(record);
1303 blimit = record + pEmr->emr.nSize;
1305 if(!core5_swap(record, torev))return(0);
1310 blimit = record + pEmr->emr.nSize;
1317 int U_EMRFRAMERGN_swap(char *record, int torev){
1320 PU_EMRFRAMERGN pEmr = (PU_EMRFRAMERGN)(record);
1323 blimit = record + pEmr->emr.nSize;
1325 if(!core5_swap(record, torev))return(0);
1331 blimit = record + pEmr->emr.nSize;
1338 int U_EMRINVERTRGN_swap(char *record, int torev){
1339 return(core11_swap(record, torev));
1343 int U_EMRPAINTRGN_swap(char *record, int torev){
1344 return(core11_swap(record, torev));
1348 int U_EMREXTSELECTCLIPRGN_swap(char *record, int torev){
1351 PU_EMREXTSELECTCLIPRGN pEmr = (PU_EMREXTSELECTCLIPRGN)(record);
1354 blimit = record + pEmr->emr.nSize;
1356 if(!core5_swap(record, torev))return(0);
1360 blimit = record + pEmr->emr.nSize;
1367 int U_EMRBITBLT_swap(char *record, int torev){
1374 PU_EMRBITBLT pEmr = (PU_EMRBITBLT) (record);
1381 blimit = record + pEmr->emr.nSize;
1382 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1384 if(!core5_swap(record, torev))return(0);
1398 blimit = record + pEmr->emr.nSize;
1399 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1406 int U_EMRSTRETCHBLT_swap(char *record, int torev){
1413 PU_EMRSTRETCHBLT pEmr = (PU_EMRSTRETCHBLT) (record);
1420 blimit = record + pEmr->emr.nSize;
1421 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1423 if(!core5_swap(record, torev))return(0);
1438 blimit = record + pEmr->emr.nSize;
1439 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1446 int U_EMRMASKBLT_swap(char *record, int torev){
1458 PU_EMRMASKBLT pEmr = (PU_EMRMASKBLT) (record);
1470 blimit = record + pEmr->emr.nSize;
1471 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1472 if(!DIB_swap(record, iUsageMask, offBmiMask, cbBmiMask, offBitsMask, cbBitsMask, blimit, torev))return(0);
1474 if(!core5_swap(record, torev))return(0);
1495 blimit = record + pEmr->emr.nSize;
1496 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1497 if(!DIB_swap(record, iUsageMask, offBmiMask, cbBmiMask, offBitsMask, cbBitsMask, blimit, torev))return(0);
1503 int U_EMRPLGBLT_swap(char *record, int torev){
1515 PU_EMRPLGBLT pEmr = (PU_EMRPLGBLT) (record);
1527 blimit = record + pEmr->emr.nSize;
1528 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1529 if(!DIB_swap(record, iUsageMask, offBmiMask, cbBmiMask, offBitsMask, cbBitsMask, blimit, torev))return(0);
1531 if(!core5_swap(record, torev))return(0);
1551 blimit = record + pEmr->emr.nSize;
1552 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1553 if(!DIB_swap(record, iUsageMask, offBmiMask, cbBmiMask, offBitsMask, cbBitsMask, blimit, torev))return(0);
1559 int U_EMRSETDIBITSTODEVICE_swap(char *record, int torev){
1566 PU_EMRSETDIBITSTODEVICE pEmr = (PU_EMRSETDIBITSTODEVICE) (record);
1573 blimit = record + pEmr->emr.nSize;
1574 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1576 if(!core5_swap(record, torev))return(0);
1587 blimit = record + pEmr->emr.nSize;
1588 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1594 int U_EMRSTRETCHDIBITS_swap(char *record, int torev){
1601 PU_EMRSTRETCHDIBITS pEmr = (PU_EMRSTRETCHDIBITS) (record);
1608 blimit = record + pEmr->emr.nSize;
1609 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1611 if(!core5_swap(record, torev))return(0);
1623 blimit = record + pEmr->emr.nSize;
1624 if(!DIB_swap(record, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, blimit, torev))return(0);
1630 int U_EMREXTCREATEFONTINDIRECTW_swap(char *record, int torev){
1632 PU_EMREXTCREATEFONTINDIRECTW pEmr = (PU_EMREXTCREATEFONTINDIRECTW) (record);
1636 if(!core5_swap(record, torev))return(0);
1651 int U_EMREXTTEXTOUTA_swap(char *record, int torev){
1652 return(core8_swap(record, torev));
1656 int U_EMREXTTEXTOUTW_swap(char *record, int torev){
1657 return(core8_swap(record, torev));
1662 \brief Convert a pointer to a U_EMR_POLYBEZIER16 record.
1663 \param record pointer to a buffer holding the EMR record
1665 int U_EMRPOLYBEZIER16_swap(char *record, int torev){
1666 return(core6_swap(record, torev));
1670 int U_EMRPOLYGON16_swap(char *record, int torev){
1671 return(core6_swap(record, torev));
1675 int U_EMRPOLYLINE16_swap(char *record, int torev){
1676 return(core6_swap(record, torev));
1680 int U_EMRPOLYBEZIERTO16_swap(char *record, int torev){
1681 return(core6_swap(record, torev));
1686 \brief Convert a pointer to a U_EMR_POLYLINETO16 record.
1687 \param record pointer to a buffer holding the EMR record
1689 int U_EMRPOLYLINETO16_swap(char *record, int torev){
1690 return(core6_swap(record, torev));
1694 int U_EMRPOLYPOLYLINE16_swap(char *record, int torev){
1695 return(core10_swap(record, torev));
1699 int U_EMRPOLYPOLYGON16_swap(char *record, int torev){
1700 return(core10_swap(record, torev));
1705 int U_EMRPOLYDRAW16_swap(char *record, int torev){
1708 PU_EMRPOLYDRAW16 pEmr = (PU_EMRPOLYDRAW16)(record);
1711 blimit = record + pEmr->emr.nSize;
1713 if(!core5_swap(record, torev))return(0);
1718 blimit = record + pEmr->emr.nSize;
1727 int U_EMRCREATEMONOBRUSH_swap(char *record, int torev){
1728 return(core12_swap(record, torev));
1732 int U_EMRCREATEDIBPATTERNBRUSHPT_swap(char *record, int torev){
1733 return(core12_swap(record, torev));
1738 int U_EMREXTCREATEPEN_swap(char *record, int torev){
1744 PU_EMREXTCREATEPEN pEmr = (PU_EMREXTCREATEPEN)(record);
1750 blimit = record + pEmr->emr.nSize;
1751 if(!DIB_swap(record, U_DIB_RGB_COLORS, offBmi, cbBmi, offBits, cbBits, blimit, torev))return(0);
1753 if(!core5_swap(record, torev))return(0);
1760 blimit = record + pEmr->emr.nSize;
1761 if(!DIB_swap(record, U_DIB_RGB_COLORS, offBmi, cbBmi, offBits, cbBits, blimit, torev))return(0);
1772 int U_EMRSETICMMODE_swap(char *record, int torev){
1773 return(core3_swap(record, torev));
1777 int U_EMRCREATECOLORSPACE_swap(char *record, int torev){
1778 if(!core5_swap(record, torev))return(0);
1779 PU_EMRCREATECOLORSPACE pEmr = (PU_EMRCREATECOLORSPACE)(record);
1786 int U_EMRSETCOLORSPACE_swap(char *record, int torev){
1787 return(core3_swap(record, torev));
1791 int U_EMRDELETECOLORSPACE_swap(char *record, int torev){
1792 return(core3_swap(record, torev));
1801 int U_EMRPIXELFORMAT_swap(char *record, int torev){
1802 if(!core5_swap(record, torev))return(0);
1803 PU_EMRPIXELFORMAT pEmr = (PU_EMRPIXELFORMAT)(record);
1816 int U_EMRSMALLTEXTOUT_swap(char *record, int torev){
1821 PU_EMRSMALLTEXTOUT pEmr = (PU_EMRSMALLTEXTOUT)(record);
1825 blimit = record + pEmr->emr.nSize;
1827 if(!core5_swap(record, torev))return(0);
1833 blimit = record + pEmr->emr.nSize;
1836 if(IS_MEM_UNSAFE(record, roff + sizeof(U_RECTL), blimit))return(0);
1837 rectl_swap( (PU_RECTL) (record + roff),1); // rclBounds
1839 if(IS_MEM_UNSAFE(record, roff + sizeof(U_RECTL) + cChars, blimit))return(0);
1856 int U_EMRALPHABLEND_swap(char *record, int torev){
1857 return(core13_swap(record, torev));
1861 int U_EMRSETLAYOUT_swap(char *record, int torev){
1862 return(core3_swap(record, torev));
1866 int U_EMRTRANSPARENTBLT_swap(char *record, int torev){
1867 return(core13_swap(record, torev));
1874 int U_EMRGRADIENTFILL_swap(char *record, int torev){
1879 PU_EMRGRADIENTFILL pEmr = (PU_EMRGRADIENTFILL)(record);
1884 blimit = record + pEmr->emr.nSize;
1886 if(!core5_swap(record, torev))return(0);
1893 blimit = record + pEmr->emr.nSize;
1895 record += sizeof(U_EMRGRADIENTFILL);
1896 if(IS_MEM_UNSAFE(record, nTriVert*sizeof(U_TRIVERTEX), blimit))return(0);
1898 trivertex_swap((PU_TRIVERTEX)(record),nTriVert); // TriVert[]
1900 record += nTriVert * sizeof(U_TRIVERTEX);
1903 if(IS_MEM_UNSAFE(record, nGradObj*sizeof(U_GRADIENT3), blimit))return(0);
1904 gradient3_swap((PU_GRADIENT3)(record), nGradObj); // GradObj[]
1907 if(IS_MEM_UNSAFE(record, nGradObj*sizeof(U_GRADIENT4), blimit))return(0);
1908 gradient4_swap((PU_GRADIENT4)(record), nGradObj); // GradObj[]
1922 int U_EMRCREATECOLORSPACEW_swap(char *record, int torev){
1923 PU_EMRCREATECOLORSPACEW pEmr = (PU_EMRCREATECOLORSPACEW)(record);
1924 if(!core5_swap(record, torev))return(0);
1935 \brief Checks the declared size of a record for consistency
1937 \param record pointer to the start of the EMF record in memory
1938 \param blimit pointer to one byte after the EMF record in memory
1939 \param nSize number of bytes in the record, read from the record
1940 \param iType type of the record, read from the record
1944 Verifies that the declared size is consistent with this type of record.
1946 int U_emf_record_sizeok(const char *record, const char *blimit, uint32_t *nSize, uint32_t *iType, int torev){
1950 /* Check that COMMON data in record can be touched without an access violation. If it cannot be
1954 if(IS_MEM_UNSAFE(record, sizeof(U_EMR), blimit))return(0);
1956 PU_ENHMETARECORD pEmr = (PU_ENHMETARECORD)(record);
1964 /* Check that the FULL record size is OK, abort if not. */
1965 if(IS_MEM_UNSAFE(record, *nSize, blimit))return(0);
2094 // record's declared size must be more than the minimum size for this type of record
2115 char *record;
2119 record = contents;
2125 if(!U_emf_record_sizeok(record, blimit, &off, &iType, torev)){
2131 case U_EMR_HEADER: rstatus=U_EMRHEADER_swap(record, torev); break;
2132 case U_EMR_POLYBEZIER: rstatus=U_EMRPOLYBEZIER_swap(record, torev); break;
2133 case U_EMR_POLYGON: rstatus=U_EMRPOLYGON_swap(record, torev); break;
2134 case U_EMR_POLYLINE: rstatus=U_EMRPOLYLINE_swap(record, torev); break;
2135 case U_EMR_POLYBEZIERTO: rstatus=U_EMRPOLYBEZIERTO_swap(record, torev); break;
2136 case U_EMR_POLYLINETO: rstatus=U_EMRPOLYLINETO_swap(record, torev); break;
2137 case U_EMR_POLYPOLYLINE: rstatus=U_EMRPOLYPOLYLINE_swap(record, torev); break;
2138 case U_EMR_POLYPOLYGON: rstatus=U_EMRPOLYPOLYGON_swap(record, torev); break;
2139 case U_EMR_SETWINDOWEXTEX: rstatus=U_EMRSETWINDOWEXTEX_swap(record, torev); break;
2140 case U_EMR_SETWINDOWORGEX: rstatus=U_EMRSETWINDOWORGEX_swap(record, torev); break;
2141 case U_EMR_SETVIEWPORTEXTEX: rstatus=U_EMRSETVIEWPORTEXTEX_swap(record, torev); break;
2142 case U_EMR_SETVIEWPORTORGEX: rstatus=U_EMRSETVIEWPORTORGEX_swap(record, torev); break;
2143 case U_EMR_SETBRUSHORGEX: rstatus=U_EMRSETBRUSHORGEX_swap(record, torev); break;
2145 rstatus=U_EMREOF_swap(record, torev);
2148 case U_EMR_SETPIXELV: rstatus=U_EMRSETPIXELV_swap(record, torev); break;
2149 case U_EMR_SETMAPPERFLAGS: rstatus=U_EMRSETMAPPERFLAGS_swap(record, torev); break;
2150 case U_EMR_SETMAPMODE: rstatus=U_EMRSETMAPMODE_swap(record, torev); break;
2151 case U_EMR_SETBKMODE: rstatus=U_EMRSETBKMODE_swap(record, torev); break;
2152 case U_EMR_SETPOLYFILLMODE: rstatus=U_EMRSETPOLYFILLMODE_swap(record, torev); break;
2153 case U_EMR_SETROP2: rstatus=U_EMRSETROP2_swap(record, torev); break;
2154 case U_EMR_SETSTRETCHBLTMODE: rstatus=U_EMRSETSTRETCHBLTMODE_swap(record, torev); break;
2155 case U_EMR_SETTEXTALIGN: rstatus=U_EMRSETTEXTALIGN_swap(record, torev); break;
2156 case U_EMR_SETCOLORADJUSTMENT: rstatus=U_EMRSETCOLORADJUSTMENT_swap(record, torev); break;
2157 case U_EMR_SETTEXTCOLOR: rstatus=U_EMRSETTEXTCOLOR_swap(record, torev); break;
2158 case U_EMR_SETBKCOLOR: rstatus=U_EMRSETBKCOLOR_swap(record, torev); break;
2159 case U_EMR_OFFSETCLIPRGN: rstatus=U_EMROFFSETCLIPRGN_swap(record, torev); break;
2160 case U_EMR_MOVETOEX: rstatus=U_EMRMOVETOEX_swap(record, torev); break;
2161 case U_EMR_SETMETARGN: rstatus=U_EMRSETMETARGN_swap(record, torev); break;
2162 case U_EMR_EXCLUDECLIPRECT: rstatus=U_EMREXCLUDECLIPRECT_swap(record, torev); break;
2163 case U_EMR_INTERSECTCLIPRECT: rstatus=U_EMRINTERSECTCLIPRECT_swap(record, torev); break;
2164 case U_EMR_SCALEVIEWPORTEXTEX: rstatus=U_EMRSCALEVIEWPORTEXTEX_swap(record, torev); break;
2165 case U_EMR_SCALEWINDOWEXTEX: rstatus=U_EMRSCALEWINDOWEXTEX_swap(record, torev); break;
2166 case U_EMR_SAVEDC: rstatus=U_EMRSAVEDC_swap(record, torev); break;
2167 case U_EMR_RESTOREDC: rstatus=U_EMRRESTOREDC_swap(record, torev); break;
2168 case U_EMR_SETWORLDTRANSFORM: rstatus=U_EMRSETWORLDTRANSFORM_swap(record, torev); break;
2169 case U_EMR_MODIFYWORLDTRANSFORM: rstatus=U_EMRMODIFYWORLDTRANSFORM_swap(record, torev); break;
2170 case U_EMR_SELECTOBJECT: rstatus=U_EMRSELECTOBJECT_swap(record, torev); break;
2171 case U_EMR_CREATEPEN: rstatus=U_EMRCREATEPEN_swap(record, torev); break;
2172 case U_EMR_CREATEBRUSHINDIRECT: rstatus=U_EMRCREATEBRUSHINDIRECT_swap(record, torev); break;
2173 case U_EMR_DELETEOBJECT: rstatus=U_EMRDELETEOBJECT_swap(record, torev); break;
2174 case U_EMR_ANGLEARC: rstatus=U_EMRANGLEARC_swap(record, torev); break;
2175 case U_EMR_ELLIPSE: rstatus=U_EMRELLIPSE_swap(record, torev); break;
2176 case U_EMR_RECTANGLE: rstatus=U_EMRRECTANGLE_swap(record, torev); break;
2177 case U_EMR_ROUNDRECT: rstatus=U_EMRROUNDRECT_swap(record, torev); break;
2178 case U_EMR_ARC: rstatus=U_EMRARC_swap(record, torev); break;
2179 case U_EMR_CHORD: rstatus=U_EMRCHORD_swap(record, torev); break;
2180 case U_EMR_PIE: rstatus=U_EMRPIE_swap(record, torev); break;
2181 case U_EMR_SELECTPALETTE: rstatus=U_EMRSELECTPALETTE_swap(record, torev); break;
2182 case U_EMR_CREATEPALETTE: rstatus=U_EMRCREATEPALETTE_swap(record, torev); break;
2183 case U_EMR_SETPALETTEENTRIES: rstatus=U_EMRSETPALETTEENTRIES_swap(record, torev); break;
2184 case U_EMR_RESIZEPALETTE: rstatus=U_EMRRESIZEPALETTE_swap(record, torev); break;
2185 case U_EMR_REALIZEPALETTE: rstatus=U_EMRREALIZEPALETTE_swap(record, torev); break;
2186 case U_EMR_EXTFLOODFILL: rstatus=U_EMREXTFLOODFILL_swap(record, torev); break;
2187 case U_EMR_LINETO: rstatus=U_EMRLINETO_swap(record, torev); break;
2188 case U_EMR_ARCTO: rstatus=U_EMRARCTO_swap(record, torev); break;
2189 case U_EMR_POLYDRAW: rstatus=U_EMRPOLYDRAW_swap(record, torev); break;
2190 case U_EMR_SETARCDIRECTION: rstatus=U_EMRSETARCDIRECTION_swap(record, torev); break;
2191 case U_EMR_SETMITERLIMIT: rstatus=U_EMRSETMITERLIMIT_swap(record, torev); break;
2192 case U_EMR_BEGINPATH: rstatus=U_EMRBEGINPATH_swap(record, torev); break;
2193 case U_EMR_ENDPATH: rstatus=U_EMRENDPATH_swap(record, torev); break;
2194 case U_EMR_CLOSEFIGURE: rstatus=U_EMRCLOSEFIGURE_swap(record, torev); break;
2195 case U_EMR_FILLPATH: rstatus=U_EMRFILLPATH_swap(record, torev); break;
2196 case U_EMR_STROKEANDFILLPATH: rstatus=U_EMRSTROKEANDFILLPATH_swap(record, torev); break;
2197 case U_EMR_STROKEPATH: rstatus=U_EMRSTROKEPATH_swap(record, torev); break;
2198 case U_EMR_FLATTENPATH: rstatus=U_EMRFLATTENPATH_swap(record, torev); break;
2199 case U_EMR_WIDENPATH: rstatus=U_EMRWIDENPATH_swap(record, torev); break;
2200 case U_EMR_SELECTCLIPPATH: rstatus=U_EMRSELECTCLIPPATH_swap(record, torev); break;
2201 case U_EMR_ABORTPATH: rstatus=U_EMRABORTPATH_swap(record, torev); break;
2202 case U_EMR_UNDEF69: rstatus=U_EMRUNDEF69_swap(record, torev); break;
2203 case U_EMR_COMMENT: rstatus=U_EMRCOMMENT_swap(record, torev); break;
2204 case U_EMR_FILLRGN: rstatus=U_EMRFILLRGN_swap(record, torev); break;
2205 case U_EMR_FRAMERGN: rstatus=U_EMRFRAMERGN_swap(record, torev); break;
2206 case U_EMR_INVERTRGN: rstatus=U_EMRINVERTRGN_swap(record, torev); break;
2207 case U_EMR_PAINTRGN: rstatus=U_EMRPAINTRGN_swap(record, torev); break;
2208 case U_EMR_EXTSELECTCLIPRGN: rstatus=U_EMREXTSELECTCLIPRGN_swap(record, torev);break;
2209 case U_EMR_BITBLT: rstatus=U_EMRBITBLT_swap(record, torev); break;
2210 case U_EMR_STRETCHBLT: rstatus=U_EMRSTRETCHBLT_swap(record, torev); break;
2211 case U_EMR_MASKBLT: rstatus=U_EMRMASKBLT_swap(record, torev); break;
2212 case U_EMR_PLGBLT: rstatus=U_EMRPLGBLT_swap(record, torev); break;
2213 case U_EMR_SETDIBITSTODEVICE: rstatus=U_EMRSETDIBITSTODEVICE_swap(record, torev); break;
2214 case U_EMR_STRETCHDIBITS: rstatus=U_EMRSTRETCHDIBITS_swap(record, torev); break;
2215 case U_EMR_EXTCREATEFONTINDIRECTW: rstatus=U_EMREXTCREATEFONTINDIRECTW_swap(record, torev); break;
2216 case U_EMR_EXTTEXTOUTA: rstatus=U_EMREXTTEXTOUTA_swap(record, torev); break;
2217 case U_EMR_EXTTEXTOUTW: rstatus=U_EMREXTTEXTOUTW_swap(record, torev); break;
2218 case U_EMR_POLYBEZIER16: rstatus=U_EMRPOLYBEZIER16_swap(record, torev); break;
2219 case U_EMR_POLYGON16: rstatus=U_EMRPOLYGON16_swap(record, torev); break;
2220 case U_EMR_POLYLINE16: rstatus=U_EMRPOLYLINE16_swap(record, torev); break;
2221 case U_EMR_POLYBEZIERTO16: rstatus=U_EMRPOLYBEZIERTO16_swap(record, torev); break;
2222 case U_EMR_POLYLINETO16: rstatus=U_EMRPOLYLINETO16_swap(record, torev); break;
2223 case U_EMR_POLYPOLYLINE16: rstatus=U_EMRPOLYPOLYLINE16_swap(record, torev); break;
2224 case U_EMR_POLYPOLYGON16: rstatus=U_EMRPOLYPOLYGON16_swap(record, torev); break;
2225 case U_EMR_POLYDRAW16: rstatus=U_EMRPOLYDRAW16_swap(record, torev); break;
2226 case U_EMR_CREATEMONOBRUSH: rstatus=U_EMRCREATEMONOBRUSH_swap(record, torev); break;
2227 case U_EMR_CREATEDIBPATTERNBRUSHPT: rstatus=U_EMRCREATEDIBPATTERNBRUSHPT_swap(record, torev); break;
2228 case U_EMR_EXTCREATEPEN: rstatus=U_EMREXTCREATEPEN_swap(record, torev); break;
2229 case U_EMR_POLYTEXTOUTA: rstatus=U_EMRPOLYTEXTOUTA_swap(record, torev); break;
2230 case U_EMR_POLYTEXTOUTW: rstatus=U_EMRPOLYTEXTOUTW_swap(record, torev); break;
2231 case U_EMR_SETICMMODE: rstatus=U_EMRSETICMMODE_swap(record, torev); break;
2232 case U_EMR_CREATECOLORSPACE: rstatus=U_EMRCREATECOLORSPACE_swap(record, torev); break;
2233 case U_EMR_SETCOLORSPACE: rstatus=U_EMRSETCOLORSPACE_swap(record, torev); break;
2234 case U_EMR_DELETECOLORSPACE: rstatus=U_EMRDELETECOLORSPACE_swap(record, torev); break;
2235 case U_EMR_GLSRECORD: rstatus=U_EMRGLSRECORD_swap(record, torev); break;
2236 case U_EMR_GLSBOUNDEDRECORD: rstatus=U_EMRGLSBOUNDEDRECORD_swap(record, torev); break;
2237 case U_EMR_PIXELFORMAT: rstatus=U_EMRPIXELFORMAT_swap(record, torev); break;
2238 case U_EMR_DRAWESCAPE: rstatus=U_EMRDRAWESCAPE_swap(record, torev); break;
2239 case U_EMR_EXTESCAPE: rstatus=U_EMREXTESCAPE_swap(record, torev); break;
2240 case U_EMR_UNDEF107: rstatus=U_EMRUNDEF107_swap(record, torev); break;
2241 case U_EMR_SMALLTEXTOUT: rstatus=U_EMRSMALLTEXTOUT_swap(record, torev); break;
2242 case U_EMR_FORCEUFIMAPPING: rstatus=U_EMRFORCEUFIMAPPING_swap(record, torev); break;
2243 case U_EMR_NAMEDESCAPE: rstatus=U_EMRNAMEDESCAPE_swap(record, torev); break;
2244 case U_EMR_COLORCORRECTPALETTE: rstatus=U_EMRCOLORCORRECTPALETTE_swap(record, torev); break;
2245 case U_EMR_SETICMPROFILEA: rstatus=U_EMRSETICMPROFILEA_swap(record, torev); break;
2246 case U_EMR_SETICMPROFILEW: rstatus=U_EMRSETICMPROFILEW_swap(record, torev); break;
2247 case U_EMR_ALPHABLEND: rstatus=U_EMRALPHABLEND_swap(record, torev); break;
2248 case U_EMR_SETLAYOUT: rstatus=U_EMRSETLAYOUT_swap(record, torev); break;
2249 case U_EMR_TRANSPARENTBLT: rstatus=U_EMRTRANSPARENTBLT_swap(record, torev); break;
2250 case U_EMR_UNDEF117: rstatus=U_EMRUNDEF117_swap(record, torev); break;
2251 case U_EMR_GRADIENTFILL: rstatus=U_EMRGRADIENTFILL_swap(record, torev); break;
2252 case U_EMR_SETLINKEDUFIS: rstatus=U_EMRSETLINKEDUFIS_swap(record, torev); break;
2253 case U_EMR_SETTEXTJUSTIFICATION: rstatus=U_EMRSETTEXTJUSTIFICATION_swap(record, torev); break;
2254 case U_EMR_COLORMATCHTOTARGETW: rstatus=U_EMRCOLORMATCHTOTARGETW_swap(record, torev); break;
2255 case U_EMR_CREATECOLORSPACEW: rstatus=U_EMRCREATECOLORSPACEW_swap(record, torev); break;
2256 default: rstatus=U_EMRNOTIMPLEMENTED_swap(record, torev); break;
2261 record += off;