Advertisement
Guest User

Untitled

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