Skip to content

Commit 0e085b7

Browse files
mjp41janvorli
authored andcommitted
Fixing PAL_TRY use in BOTR (dotnet#7658)
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.
1 parent afed5fd commit 0e085b7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Documentation/botr/exceptions.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,16 @@ To use the callout filter, instead of this:
278278
write this:
279279

280280
BOOL OneShot = TRUE;
281-
282-
PAL_TRY
281+
struct Param {
282+
BSTR* pBSTR;
283+
int length;
284+
};
285+
struct Param param;
286+
param.pBSTR = pBSTR;
287+
288+
PAL_TRY(Param*, pParam, &param)
283289
{
284-
length = SysStringLen(pBSTR);
290+
pParam->length = SysStringLen(pParam->pBSTR);
285291
}
286292
PAL_EXCEPT_FILTER(CallOutFilter, &OneShot)
287293
{

0 commit comments

Comments
 (0)