Fixing PAL_TRY use in BOTR (#7658)
authorMatthew Parkinson <mjp41@users.noreply.github.com>
Mon, 17 Oct 2016 22:56:50 +0000 (23:56 +0100)
committerJan Vorlicek <janvorli@microsoft.com>
Mon, 17 Oct 2016 22:56:50 +0000 (00:56 +0200)
In the Exceptions Section it gives an example use of `PAL_TRY`,
but the parameters to the `PAL_TRY` need to be passed as an argument,
and cannot be implicit.  This commit brings the change inline with
the programming model.

Documentation/botr/exceptions.md

index daa684b..8e4b77a 100644 (file)
@@ -278,10 +278,16 @@ To use the callout filter, instead of this:
 write this:
 
     BOOL OneShot = TRUE;
-
-    PAL_TRY
+    struct Param {
+        BSTR*  pBSTR;
+        int length;
+    };
+    struct Param param;
+    param.pBSTR = pBSTR;
+
+    PAL_TRY(Param*, pParam, &param)
     {
-      length = SysStringLen(pBSTR);
+      pParam->length = SysStringLen(pParam->pBSTR);
     }
     PAL_EXCEPT_FILTER(CallOutFilter, &OneShot)
     {