Advertisement
Guest User

Untitled

a guest
Nov 18th, 2022
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 19.94 KB | Source Code | 0 0
  1. #define __in
  2. #define __out
  3. #define __inout
  4. #define __in_opt
  5. #define __out_opt
  6. #define __inout_opt
  7. #define __in_ecount(x)
  8. #define __out_ecount(x)
  9. #define __deref_out_ecount(x)
  10. #define __inout_ecount(x)
  11. #define __in_bcount(x)
  12. #define __out_bcount(x)
  13. #define __out_bcount_part(x, y)
  14. #define __deref_out_bcount(x)
  15. #define __deref_out_range(x, y)
  16. #define __deref_inout_bcount_part(x, y)
  17. #define __success(x)
  18. #define __inout_bcount(x)
  19. #define __deref_opt_out
  20. #define __deref_out_opt
  21. #define __deref_out_ecount_opt(x)
  22. #define __deref_out
  23. #define __checkReturn
  24. #define __callback
  25. #define __nullterminated
  26.  
  27. typedef unsigned char bool;
  28. typedef unsigned short wchar_t;
  29. typedef long HRESULT;
  30.  
  31. typedef unsigned __int64 ULONG_PTR;
  32.  
  33. #define HKCODEGEN
  34. #include "hkenggen.h"
  35. #include "hkrtgen.h"
  36. #include "hkgenlib.h"
  37.  
  38. #define ENABLE_INTSAFE_SIGNED_FUNCTIONS
  39. #include "intsafe.h"
  40.  
  41. #ifndef HOTPATCH_BUFFER_SIZE
  42. #define HOTPATCH_BUFFER_SIZE 256
  43.  
  44. typedef struct _PATCH_BUFFER {
  45.    unsigned short PointerIndex;
  46.    unsigned short Fill1;
  47.    unsigned short BufferSize;
  48.    unsigned short Fill2;
  49.    unsigned __int64 Buffer[(HOTPATCH_BUFFER_SIZE - 8) / sizeof(__int64)];
  50. } PATCH_BUFFER;
  51.  
  52. PATCH_BUFFER HotPatchBuffer = {0, 0, HOTPATCH_BUFFER_SIZE, 0};
  53. #endif
  54.  
  55. int memcmp(const void*, const void*, size_t);
  56. void *memset(void*, int, size_t);
  57.  
  58. #pragma deprecated (memcpy)
  59.  
  60. #define offsetof(s,f)   ((size_t)&(((s*)0)->f))
  61.  
  62. struct hkt_1125579048
  63. {
  64.     long hkc_1;
  65. };
  66. struct hkif_112557904800002
  67. {
  68.     long hknc;
  69. };
  70. struct hkis_112557904800002
  71. {
  72.     long hknc;
  73. };
  74. struct HkTableMD* TableTypeMD[1];
  75. struct HkCollationType HkCollationTypes[];
  76. struct HkCollationCallback* HkCollationCallbacks[];
  77. struct var_struct
  78. {
  79.     unsigned long stmtSavepoint;
  80.     unsigned long yc;
  81.     __int64 txTemporalTime;
  82. };
  83. struct cursor_struct_type
  84. {
  85.     struct HkCursorRange* cursor_1;
  86.     struct HkCursorRange* cursor_2;
  87.     struct HkCursorRange* cursor_3;
  88. };
  89. long stmtParentNodeIdArray[6] =
  90. {
  91.     -1,
  92.     0,
  93.     1,
  94.     1,
  95.     3,
  96.     3,
  97. };
  98. long executionsInheritanceArray[6] =
  99. {
  100.     1,
  101.     3,
  102.     -1,
  103.     5,
  104.     -1,
  105.     -1,
  106. };
  107. unsigned char didGenerateGetFirstArray[6] =
  108. {
  109.     0,
  110.     0,
  111.     1,
  112.     0,
  113.     1,
  114.     1,
  115. };
  116. unsigned char wasPassedReturnRowArray[6] =
  117. {
  118.     0,
  119.     1,
  120.     1,
  121.     1,
  122.     0,
  123.     1,
  124. };
  125. HRESULT query_fn_6(
  126.     struct HkProcContext* context,
  127.     union HkValue valueArray[],
  128.     unsigned char* nullArray,
  129.     struct var_struct* vars,
  130.     struct cursor_struct_type* cursors)
  131. {
  132.     HRESULT hr = 0;
  133.     struct hkt_1125579048* rec1_41 = 0;
  134.     struct HkSearchKey* startKeyPtr_41 = 0;
  135.     struct HkSearchKey* endKeyPtr_41 = 0;
  136.     long startKey_41;
  137.     long endKey_41;
  138.     unsigned long intervalCount_43 = 0;
  139.     unsigned long intervalInd_43 = 0;
  140.     struct hkt_1125579048* rec1_48 = 0;
  141.     struct HkSearchKey* startKeyPtr_48 = 0;
  142.     struct HkSearchKey* endKeyPtr_48 = 0;
  143.     long startKey_48;
  144.     long endKey_48;
  145.     unsigned long intervalCount_50 = 0;
  146.     unsigned long intervalInd_50 = 0;
  147.     struct hkt_1125579048* rec1_56 = 0;
  148.     struct HkSearchKey* startKeyPtr_56 = 0;
  149.     struct HkSearchKey* endKeyPtr_56 = 0;
  150.     long startKey_56;
  151.     long endKey_56;
  152.     unsigned long intervalCount_58 = 0;
  153.     unsigned long intervalInd_58 = 0;
  154.     {
  155.         static wchar_t const hkl_7[] =
  156.         {
  157.             105,
  158.         };
  159.         static wchar_t const hkl_8[] =
  160.         {
  161.             105,
  162.         };
  163.         static wchar_t const hkl_9[] =
  164.         {
  165.             105,
  166.         };
  167.         static unsigned char const hkl_10[] =
  168.         {
  169.             0,
  170.             0,
  171.             8,
  172.             0,
  173.             56,
  174.             1,
  175.             105,
  176.             0,
  177.         };
  178.         static unsigned char const hkl_11[] =
  179.         {
  180.             0,
  181.             0,
  182.             8,
  183.             0,
  184.             56,
  185.             1,
  186.             105,
  187.             0,
  188.         };
  189.         static unsigned char const hkl_12[] =
  190.         {
  191.             0,
  192.             0,
  193.             8,
  194.             0,
  195.             56,
  196.             1,
  197.             105,
  198.             0,
  199.         };
  200.         static unsigned char const hkl_13[] =
  201.         {
  202.             0,
  203.             0,
  204.             8,
  205.             0,
  206.             56,
  207.             1,
  208.             105,
  209.             0,
  210.         };
  211.         static unsigned char const hkl_14[] =
  212.         {
  213.             0,
  214.             0,
  215.             8,
  216.             0,
  217.             56,
  218.             1,
  219.             105,
  220.             0,
  221.         };
  222.         static unsigned char const hkl_15[] =
  223.         {
  224.             0,
  225.             0,
  226.             8,
  227.             0,
  228.             56,
  229.             1,
  230.             105,
  231.             0,
  232.         };
  233.         static unsigned char const hkl_16[] =
  234.         {
  235.             0,
  236.             0,
  237.             8,
  238.             0,
  239.             56,
  240.             1,
  241.             105,
  242.             0,
  243.         };
  244.         static unsigned char const hkl_17[] =
  245.         {
  246.             0,
  247.             0,
  248.             8,
  249.             0,
  250.             56,
  251.             1,
  252.             105,
  253.             0,
  254.         };
  255.         static unsigned char const hkl_18[] =
  256.         {
  257.             0,
  258.             0,
  259.             8,
  260.             0,
  261.             56,
  262.             1,
  263.             105,
  264.             0,
  265.         };
  266.         static unsigned char const hkl_19[] =
  267.         {
  268.             0,
  269.             0,
  270.             0,
  271.             0,
  272.             8,
  273.             0,
  274.             56,
  275.             1,
  276.             105,
  277.             0,
  278.         };
  279.         static unsigned char const hkl_20[] =
  280.         {
  281.             0,
  282.             0,
  283.             0,
  284.             0,
  285.             8,
  286.             0,
  287.             56,
  288.             1,
  289.             105,
  290.             0,
  291.         };
  292.         static unsigned char const hkl_21[] =
  293.         {
  294.             0,
  295.             0,
  296.             0,
  297.             0,
  298.             8,
  299.             0,
  300.             56,
  301.             1,
  302.             105,
  303.             0,
  304.         };
  305.         static unsigned char const hkl_22[] =
  306.         {
  307.             0,
  308.             0,
  309.             0,
  310.             0,
  311.             8,
  312.             0,
  313.             56,
  314.             1,
  315.             105,
  316.             0,
  317.         };
  318.         static unsigned char const hkl_23[] =
  319.         {
  320.             0,
  321.             0,
  322.             0,
  323.             0,
  324.             8,
  325.             0,
  326.             56,
  327.             1,
  328.             105,
  329.             0,
  330.         };
  331.         static unsigned char const hkl_24[] =
  332.         {
  333.             0,
  334.             0,
  335.             0,
  336.             0,
  337.             8,
  338.             0,
  339.             56,
  340.             1,
  341.             105,
  342.             0,
  343.         };
  344.         static unsigned char const hkl_25[] =
  345.         {
  346.             0,
  347.             0,
  348.             0,
  349.             0,
  350.             8,
  351.             0,
  352.             56,
  353.             1,
  354.             105,
  355.             0,
  356.         };
  357.         static unsigned char const hkl_26[] =
  358.         {
  359.             0,
  360.             0,
  361.             0,
  362.             0,
  363.             8,
  364.             0,
  365.             56,
  366.             1,
  367.             105,
  368.             0,
  369.         };
  370.         static unsigned char const hkl_27[] =
  371.         {
  372.             0,
  373.             0,
  374.             0,
  375.             0,
  376.             8,
  377.             0,
  378.             56,
  379.             1,
  380.             105,
  381.             0,
  382.         };
  383.         static unsigned char const hkl_28[] =
  384.         {
  385.             0,
  386.             0,
  387.             0,
  388.             0,
  389.             8,
  390.             0,
  391.             56,
  392.             1,
  393.             105,
  394.             0,
  395.         };
  396.         static unsigned char const hkl_29[] =
  397.         {
  398.             0,
  399.             0,
  400.             0,
  401.             0,
  402.             8,
  403.             0,
  404.             56,
  405.             1,
  406.             105,
  407.             0,
  408.         };
  409.         static unsigned char const hkl_30[] =
  410.         {
  411.             0,
  412.             0,
  413.             0,
  414.             0,
  415.             8,
  416.             0,
  417.             56,
  418.             1,
  419.             105,
  420.             0,
  421.         };
  422.         static unsigned char const hkl_31[] =
  423.         {
  424.             0,
  425.         };
  426.         static unsigned char const hkl_32[] =
  427.         {
  428.             0,
  429.         };
  430.         static wchar_t const* const columnNames[] =
  431.         {
  432.             hkl_7,
  433.             hkl_8,
  434.             hkl_9,
  435.         };
  436.         static unsigned char const columnNameLengths[] =
  437.         {
  438.             1,
  439.             1,
  440.             1,
  441.         };
  442.         static unsigned char const outputTypes[] =
  443.         {
  444.             0,
  445.             0,
  446.             0,
  447.         };
  448.         static unsigned char const outputNullables[] =
  449.         {
  450.             0,
  451.             0,
  452.             0,
  453.         };
  454.         static unsigned char const outputPrecisions[] =
  455.         {
  456.             0,
  457.             0,
  458.             0,
  459.         };
  460.         static unsigned char const outputScales[] =
  461.         {
  462.             0,
  463.             0,
  464.             0,
  465.         };
  466.         static unsigned long outputCollations[] =
  467.         {
  468.             0,
  469.             0,
  470.             0,
  471.         };
  472.         static unsigned short const outputMaxLengths[] =
  473.         {
  474.             0,
  475.             0,
  476.             0,
  477.         };
  478.         static unsigned char const outputStatusBits[] =
  479.         {
  480.             2,
  481.             2,
  482.             2,
  483.         };
  484.         static unsigned char const* const tdsBufs[] =
  485.         {
  486.             hkl_10,
  487.             hkl_11,
  488.             hkl_12,
  489.             hkl_13,
  490.             hkl_14,
  491.             hkl_15,
  492.             hkl_16,
  493.             hkl_17,
  494.             hkl_18,
  495.             hkl_19,
  496.             hkl_20,
  497.             hkl_21,
  498.             hkl_22,
  499.             hkl_23,
  500.             hkl_24,
  501.             hkl_25,
  502.             hkl_26,
  503.             hkl_27,
  504.             hkl_28,
  505.             hkl_29,
  506.             hkl_30,
  507.         };
  508.         static unsigned short const tdsBufLengths[] =
  509.         {
  510.             8,
  511.             8,
  512.             8,
  513.             8,
  514.             8,
  515.             8,
  516.             8,
  517.             8,
  518.             8,
  519.             10,
  520.             10,
  521.             10,
  522.             10,
  523.             10,
  524.             10,
  525.             10,
  526.             10,
  527.             10,
  528.             10,
  529.             10,
  530.             10,
  531.         };
  532.         static unsigned char const hkl_33[] =
  533.         {
  534.             0,
  535.             0,
  536.         };
  537.         static unsigned char const* const tdsDataClassificationBufs[] =
  538.         {
  539.             hkl_31,
  540.             hkl_32,
  541.         };
  542.         static unsigned short const tdsDataClassificationBufLengths[] =
  543.         {
  544.             0,
  545.             0,
  546.         };
  547.         static struct HkOutputMetadata outputMetadata =
  548.         {
  549.             34,
  550.             6,
  551.             3,
  552.             columnNameLengths,
  553.             columnNames,
  554.             outputTypes,
  555.             outputNullables,
  556.             outputPrecisions,
  557.             outputScales,
  558.             outputMaxLengths,
  559.             outputCollations,
  560.             outputStatusBits,
  561.             0,
  562.             0,
  563.             tdsBufs,
  564.             tdsBufLengths,
  565.             7,
  566.             hkl_33,
  567.             2,
  568.             tdsDataClassificationBufs,
  569.             tdsDataClassificationBufLengths,
  570.         };
  571.         unsigned __int64 actualExecs[6] =
  572.         {
  573.             0,
  574.         };
  575.         unsigned __int64 actualRows[6] =
  576.         {
  577.             0,
  578.         };
  579.         unsigned __int64 actualTicks[6] =
  580.         {
  581.             0,
  582.         };
  583.         unsigned __int64 actualCpuTicks[6] =
  584.         {
  585.             0,
  586.         };
  587.         long normalizedStartPrefix_44 = 0;
  588.         long normalizedEndPrefix_44 = 0;
  589.         long normalizedStartPrefix_51 = 0;
  590.         long normalizedEndPrefix_51 = 0;
  591.         long normalizedStartPrefix_59 = 0;
  592.         long normalizedEndPrefix_59 = 0;
  593.         unsigned char result_62;
  594.         unsigned char result_isnull_62;
  595.         __int64 temp_63;
  596.         __int64 temp_66;
  597.         long valueExpr_69 = (-2147483647 - 1);
  598.         long valueExpr_70 = (-2147483647 - 1);
  599.         long valueExpr_71 = (-2147483647 - 1);
  600.         ReportStmtStarted((context->StmtPerf));
  601.         if ((context->IsInTrigger))
  602.         {
  603.             hr = -2113929163;
  604.             {
  605.                 CreateError((context->ErrorObject), hr, 0);
  606.             }
  607.             if ((FAILED(hr)))
  608.             {
  609.                 goto l_5;
  610.             }
  611.         }
  612.         if (((context->TdsContext)->isNetworkOptimized))
  613.         {
  614.             hr = (SendOptimizedMetadata(context, (&outputMetadata)));
  615.             if ((FAILED(hr)))
  616.             {
  617.                 {
  618.                 }
  619.                 goto l_5;
  620.             }
  621.         }
  622.         else
  623.         {
  624.             hr = (SendNonOptimizedMetadata(context, (&outputMetadata)));
  625.             if ((FAILED(hr)))
  626.             {
  627.                 {
  628.                 }
  629.                 goto l_5;
  630.             }
  631.         }
  632.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 0, 0, 0);
  633.         goto l_42;
  634.     l_42:;
  635.         (actualExecs[5]) = ((actualExecs[5]) + 1);
  636.         startKey_41 = 0;
  637.         startKeyPtr_41 = ((struct HkSearchKey*)(&startKey_41));
  638.         endKey_41 = 0;
  639.         endKeyPtr_41 = ((struct HkSearchKey*)(&endKey_41));
  640.         intervalCount_43 = 1;
  641.         intervalInd_43 = 0;
  642.         startKeyPtr_41 = 0;
  643.         endKeyPtr_41 = 0;
  644.         normalizedStartPrefix_44 = startKey_41;
  645.         normalizedEndPrefix_44 = endKey_41;
  646.         while ((intervalInd_43 < intervalCount_43))
  647.         {
  648.             hr = (YieldCheck(context, 1, 0));
  649.             if ((FAILED(hr)))
  650.             {
  651.                 {
  652.                 }
  653.                 goto l_5;
  654.             }
  655.             hr = (HkCursorRangeGetFirst((cursors->cursor_1), (context->TableVarTransaction), startKeyPtr_41, endKeyPtr_41, 0, 1, 0, ((struct HkRow const**)(&rec1_41))));
  656.             if ((FAILED(hr)))
  657.             {
  658.                 {
  659.                 }
  660.                 goto l_5;
  661.             }
  662.         l_45:;
  663.             if ((hr == 0))
  664.             {
  665.                 (actualRows[5]) = ((actualRows[5]) + 1);
  666.                 MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 5, 0);
  667.                 goto l_39;
  668.             }
  669.             intervalInd_43 = (intervalInd_43 + 1);
  670.             startKey_41 = normalizedStartPrefix_44;
  671.             endKey_41 = normalizedEndPrefix_44;
  672.         }
  673.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 5, 0);
  674.         goto l_36;
  675.     l_46:;
  676.         hr = (HkCursorRangeGetNext((cursors->cursor_1), (context->ErrorObject), ((struct HkRow const**)(&rec1_41))));
  677.         if ((FAILED(hr)))
  678.         {
  679.             {
  680.             }
  681.             goto l_5;
  682.         }
  683.         goto l_45;
  684.     l_49:;
  685.         (actualExecs[4]) = ((actualExecs[4]) + 1);
  686.         startKey_48 = 0;
  687.         startKeyPtr_48 = ((struct HkSearchKey*)(&startKey_48));
  688.         endKey_48 = 0;
  689.         endKeyPtr_48 = ((struct HkSearchKey*)(&endKey_48));
  690.         intervalCount_50 = 1;
  691.         intervalInd_50 = 0;
  692.         startKeyPtr_48 = 0;
  693.         endKeyPtr_48 = 0;
  694.         normalizedStartPrefix_51 = startKey_48;
  695.         normalizedEndPrefix_51 = endKey_48;
  696.         while ((intervalInd_50 < intervalCount_50))
  697.         {
  698.             hr = (YieldCheck(context, 1, 0));
  699.             if ((FAILED(hr)))
  700.             {
  701.                 {
  702.                 }
  703.                 goto l_5;
  704.             }
  705.             hr = (HkCursorRangeGetFirst((cursors->cursor_2), (context->TableVarTransaction), startKeyPtr_48, endKeyPtr_48, 0, 1, 0, ((struct HkRow const**)(&rec1_48))));
  706.             if ((FAILED(hr)))
  707.             {
  708.                 {
  709.                 }
  710.                 goto l_5;
  711.             }
  712.         l_52:;
  713.             if ((hr == 0))
  714.             {
  715.                 (actualRows[4]) = ((actualRows[4]) + 1);
  716.                 MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 4, 0);
  717.                 goto l_38;
  718.             }
  719.             intervalInd_50 = (intervalInd_50 + 1);
  720.             startKey_48 = normalizedStartPrefix_51;
  721.             endKey_48 = normalizedEndPrefix_51;
  722.         }
  723.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 4, 0);
  724.         goto l_46;
  725.     l_53:;
  726.         hr = (HkCursorRangeGetNext((cursors->cursor_2), (context->ErrorObject), ((struct HkRow const**)(&rec1_48))));
  727.         if ((FAILED(hr)))
  728.         {
  729.             {
  730.             }
  731.             goto l_5;
  732.         }
  733.         goto l_52;
  734.     l_39:;
  735.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 3, 0);
  736.         goto l_49;
  737.     l_57:;
  738.         (actualExecs[2]) = ((actualExecs[2]) + 1);
  739.         startKey_56 = 0;
  740.         startKeyPtr_56 = ((struct HkSearchKey*)(&startKey_56));
  741.         endKey_56 = 0;
  742.         endKeyPtr_56 = ((struct HkSearchKey*)(&endKey_56));
  743.         intervalCount_58 = 1;
  744.         intervalInd_58 = 0;
  745.         startKeyPtr_56 = 0;
  746.         endKeyPtr_56 = 0;
  747.         normalizedStartPrefix_59 = startKey_56;
  748.         normalizedEndPrefix_59 = endKey_56;
  749.         while ((intervalInd_58 < intervalCount_58))
  750.         {
  751.             hr = (YieldCheck(context, 1, 0));
  752.             if ((FAILED(hr)))
  753.             {
  754.                 {
  755.                 }
  756.                 goto l_5;
  757.             }
  758.             hr = (HkCursorRangeGetFirst((cursors->cursor_3), (context->TableVarTransaction), startKeyPtr_56, endKeyPtr_56, 0, 1, 0, ((struct HkRow const**)(&rec1_56))));
  759.             if ((FAILED(hr)))
  760.             {
  761.                 {
  762.                 }
  763.                 goto l_5;
  764.             }
  765.         l_60:;
  766.             if ((hr == 0))
  767.             {
  768.                 (actualRows[2]) = ((actualRows[2]) + 1);
  769.                 MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 2, 0);
  770.                 goto l_54;
  771.             }
  772.             intervalInd_58 = (intervalInd_58 + 1);
  773.             startKey_56 = normalizedStartPrefix_59;
  774.             endKey_56 = normalizedEndPrefix_59;
  775.         }
  776.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 2, 0);
  777.         goto l_53;
  778.     l_61:;
  779.         hr = (HkCursorRangeGetNext((cursors->cursor_3), (context->ErrorObject), ((struct HkRow const**)(&rec1_56))));
  780.         if ((FAILED(hr)))
  781.         {
  782.             {
  783.             }
  784.             goto l_5;
  785.         }
  786.         goto l_60;
  787.     l_38:;
  788.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 1, 0);
  789.         goto l_57;
  790.     l_54:;
  791.         result_62 = 0;
  792.         result_isnull_62 = 0;
  793.         if ((! 0))
  794.         {
  795.             temp_63 = (((__int64)(rec1_41->hkc_1)) + ((__int64)(rec1_56->hkc_1)));
  796.             if ((temp_63 < (-2147483647 - 1)))
  797.             {
  798.                 hr = -2113929211;
  799.                 {
  800.                     hr = (CreateError((context->ErrorObject), hr, 2, 26, 0));
  801.                 }
  802.                 if ((FAILED(hr)))
  803.                 {
  804.                     goto l_5;
  805.                 }
  806.             }
  807.             if ((temp_63 > 2147483647))
  808.             {
  809.                 hr = -2113929212;
  810.                 {
  811.                     hr = (CreateError((context->ErrorObject), hr, 2, 26, 0));
  812.                 }
  813.                 if ((FAILED(hr)))
  814.                 {
  815.                     goto l_5;
  816.                 }
  817.             }
  818.             temp_66 = (((__int64)((long)temp_63)) + ((__int64)(rec1_48->hkc_1)));
  819.             if ((temp_66 < (-2147483647 - 1)))
  820.             {
  821.                 hr = -2113929211;
  822.                 {
  823.                     hr = (CreateError((context->ErrorObject), hr, 2, 26, 0));
  824.                 }
  825.                 if ((FAILED(hr)))
  826.                 {
  827.                     goto l_5;
  828.                 }
  829.             }
  830.             if ((temp_66 > 2147483647))
  831.             {
  832.                 hr = -2113929212;
  833.                 {
  834.                     hr = (CreateError((context->ErrorObject), hr, 2, 26, 0));
  835.                 }
  836.                 if ((FAILED(hr)))
  837.                 {
  838.                     goto l_5;
  839.                 }
  840.             }
  841.             result_62 = (((long)temp_66) == 3600);
  842.         }
  843.         else
  844.         {
  845.             result_isnull_62 = 1;
  846.         }
  847.         if (((! result_isnull_62) && result_62))
  848.         {
  849.             {
  850.                 (actualRows[1]) = ((actualRows[1]) + 1);
  851.                 MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 1, 0);
  852.                 goto l_37;
  853.             }
  854.         }
  855.         else
  856.         {
  857.             MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 1, 0);
  858.             goto l_61;
  859.         }
  860.     l_37:;
  861.         valueExpr_69 = (rec1_41->hkc_1);
  862.         valueExpr_70 = (rec1_56->hkc_1);
  863.         valueExpr_71 = (rec1_48->hkc_1);
  864.         if (((context->TdsContext)->isNetworkOptimized))
  865.         {
  866.             hr = (StartRow(context));
  867.             if ((FAILED(hr)))
  868.             {
  869.                 {
  870.                 }
  871.                 goto l_5;
  872.             }
  873.             hr = (SendLong(context, valueExpr_69));
  874.             if ((FAILED(hr)))
  875.             {
  876.                 {
  877.                 }
  878.                 goto l_5;
  879.             }
  880.             hr = (SendLong(context, valueExpr_70));
  881.             if ((FAILED(hr)))
  882.             {
  883.                 {
  884.                 }
  885.                 goto l_5;
  886.             }
  887.             hr = (SendLong(context, valueExpr_71));
  888.             if ((FAILED(hr)))
  889.             {
  890.                 {
  891.                 }
  892.                 goto l_5;
  893.             }
  894.             EndRow(context);
  895.         }
  896.         else
  897.         {
  898.             (((context->HkValuesBuffer)[0]).SignedIntData) = valueExpr_69;
  899.             ((context->NullsBuffer)[0]) = 0;
  900.             (((context->HkValuesBuffer)[1]).SignedIntData) = valueExpr_70;
  901.             ((context->NullsBuffer)[1]) = 0;
  902.             (((context->HkValuesBuffer)[2]).SignedIntData) = valueExpr_71;
  903.             ((context->NullsBuffer)[2]) = 0;
  904.             hr = (SendNonOptimizedOutput(context, 0));
  905.             if ((FAILED(hr)))
  906.             {
  907.                 {
  908.                 }
  909.                 goto l_5;
  910.             }
  911.         }
  912.         (actualRows[0]) = ((actualRows[0]) + 1);
  913.         MeasureAndAggregateElapsedTime((context->StmtExecStats), actualTicks, actualCpuTicks, 6, 0, 0);
  914.         goto l_35;
  915.     l_35:;
  916.         goto l_61;
  917.     l_36:;
  918.         if (((context->TdsContext)->isNetworkOptimized))
  919.         {
  920.             EndOptimizedResultSet(context);
  921.         }
  922.         else
  923.         {
  924.             hr = (SendNonOptimizedOutput(context, 1));
  925.             if ((FAILED(hr)))
  926.             {
  927.                 {
  928.                 }
  929.                 goto l_5;
  930.             }
  931.         }
  932.         hr = (GenerateStmtStatistics((context->StmtExecStats), actualRows, actualExecs, actualTicks, actualCpuTicks, 6, 0));
  933.         if ((FAILED(hr)))
  934.         {
  935.             {
  936.             }
  937.             goto l_5;
  938.         }
  939.         goto l_5;
  940.     l_5:;
  941.         ReportStmtEnded((context->StmtPerf), 0, hr);
  942.         if ((FAILED(hr)))
  943.         {
  944.             SetLineNumberForError((context->ErrorObject), 6);
  945.             goto l_6;
  946.         }
  947.     }
  948.     goto l_6;
  949. l_6:;
  950.     return hr;
  951. }
  952. struct HkQueryStmtInfo StmtInfoArray[] =
  953. {
  954.  
  955.     {
  956.         374,
  957.         588,
  958.         6,
  959.         4294967295,
  960.         stmtParentNodeIdArray,
  961.         executionsInheritanceArray,
  962.         didGenerateGetFirstArray,
  963.         wasPassedReturnRowArray,
  964.         6,
  965.     },
  966. };
  967. unsigned long TableTypeIds[] =
  968. {
  969.     1125579048,
  970. };
  971. unsigned char TableTypeInternalTablesNeeded[] =
  972. {
  973.     0,
  974. };
  975. HRESULT hkp_1045578763(
  976.     struct HkProcContext* context,
  977.     union HkValue valueArray[],
  978.     unsigned char* nullArray)
  979. {
  980.     struct var_struct varstruct =
  981.     {
  982.         0,
  983.         0,
  984.         0,
  985.     };
  986.     struct var_struct* vars = (&varstruct);
  987.     HRESULT hr = 0;
  988.     void* sacrificialTemp;
  989.     struct cursor_struct_type cursorstruct =
  990.     {
  991.         0,
  992.         0,
  993.         0,
  994.     };
  995.     struct cursor_struct_type* cursors = (&cursorstruct);
  996.     hr = (HkCursorRangeAlloc(((context->TableParams)[0]), 0, 0, 0, (context->ErrorObject), ((struct HkCursorRange**)(&sacrificialTemp)), 0));
  997.     if ((FAILED(hr)))
  998.     {
  999.         {
  1000.         }
  1001.         goto l_2;
  1002.     }
  1003.     (cursors->cursor_1) = ((struct HkCursorRange*)sacrificialTemp);
  1004.     hr = (HkCursorRangeAlloc(((context->TableParams)[0]), 0, 0, 0, (context->ErrorObject), ((struct HkCursorRange**)(&sacrificialTemp)), 0));
  1005.     if ((FAILED(hr)))
  1006.     {
  1007.         {
  1008.         }
  1009.         goto l_2;
  1010.     }
  1011.     (cursors->cursor_2) = ((struct HkCursorRange*)sacrificialTemp);
  1012.     hr = (HkCursorRangeAlloc(((context->TableParams)[0]), 0, 0, 0, (context->ErrorObject), ((struct HkCursorRange**)(&sacrificialTemp)), 0));
  1013.     if ((FAILED(hr)))
  1014.     {
  1015.         {
  1016.         }
  1017.         goto l_2;
  1018.     }
  1019.     (cursors->cursor_3) = ((struct HkCursorRange*)sacrificialTemp);
  1020.     {
  1021.         hr = (query_fn_6(context, valueArray, nullArray, vars, cursors));
  1022.         if ((FAILED(hr)))
  1023.         {
  1024.             {
  1025.             }
  1026.             goto l_3;
  1027.         }
  1028.         goto l_3;
  1029.     l_3:;
  1030.         if ((FAILED(hr)))
  1031.         {
  1032.             SetLineNumberForError((context->ErrorObject), 6);
  1033.             goto l_2;
  1034.         }
  1035.     }
  1036.     (vars->yc) = ((vars->yc) + 1);
  1037.     ((valueArray[0]).SignedIntData) = 0;
  1038.     (nullArray[0]) = 0;
  1039.     hr = (YieldCheck(context, (vars->yc), 0));
  1040.     if ((FAILED(hr)))
  1041.     {
  1042.         {
  1043.         }
  1044.         goto l_2;
  1045.     }
  1046.     (vars->yc) = 0;
  1047.     goto l_2;
  1048. l_2:;
  1049.     if ((! (FAILED(hr))))
  1050.     {
  1051.     }
  1052.     if (((cursors->cursor_1) != 0))
  1053.     {
  1054.         HkCursorRangeFree((cursors->cursor_1));
  1055.     }
  1056.     if (((cursors->cursor_2) != 0))
  1057.     {
  1058.         HkCursorRangeFree((cursors->cursor_2));
  1059.     }
  1060.     if (((cursors->cursor_3) != 0))
  1061.     {
  1062.         HkCursorRangeFree((cursors->cursor_3));
  1063.     }
  1064.     return hr;
  1065. }
  1066. HRESULT hkq_1045578763(
  1067.     struct HkProcContext* context,
  1068.     union HkValue valueArray[],
  1069.     unsigned char* nullArray)
  1070. {
  1071.     HRESULT hr = 0;
  1072.     SkipBytes(context, 15);
  1073.     hr = (EndTdsParse(context));
  1074.     if ((FAILED(hr)))
  1075.     {
  1076.         {
  1077.         }
  1078.         goto l_74;
  1079.     }
  1080.     return (hkp_1045578763(context, valueArray, nullArray));
  1081.     goto l_74;
  1082. l_74:;
  1083.     return hr;
  1084. }
  1085. HRESULT hkr_1045578763(
  1086.     struct HkProcContext* context,
  1087.     union HkValue valueArray[],
  1088.     unsigned char* nullArray)
  1089. {
  1090.     HRESULT hr = 0;
  1091.     hr = (SendReturnStatus(context, ((valueArray[0]).SignedIntData)));
  1092.     if ((FAILED(hr)))
  1093.     {
  1094.         {
  1095.         }
  1096.         goto l_76;
  1097.     }
  1098.     goto l_76;
  1099. l_76:;
  1100.     return hr;
  1101. }
  1102. struct HkProcInfo ProcInfo =
  1103. {
  1104.     hkp_1045578763,
  1105.     hkq_1045578763,
  1106.     hkr_1045578763,
  1107.     0,
  1108.     0,
  1109.     0,
  1110.     3,
  1111.     0,
  1112.     0,
  1113.     1,
  1114.     1,
  1115.     0,
  1116.     1,
  1117.     TableTypeIds,
  1118.     TableTypeInternalTablesNeeded,
  1119.     TableTypeMD,
  1120.     0,
  1121.     0,
  1122.     0,
  1123.     1,
  1124.     0,
  1125.     2,
  1126.     0,
  1127.     0,
  1128.     1,
  1129.     StmtInfoArray,
  1130.     0,
  1131.     0,
  1132.     0,
  1133.     0,
  1134. };
  1135. __declspec(dllexport)
  1136. struct HkProcBindings g_Bindings =
  1137. {
  1138.     0,
  1139.     0,
  1140.     0,
  1141.  
  1142.     {
  1143.         0,
  1144.         0,
  1145.         0,
  1146.     },
  1147.     1045578763,
  1148.     (&ProcInfo),
  1149.     0,
  1150. };
  1151.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement