Skip to content

Commit e98e900

Browse files
committed
[UCRT] Make SEH blocks ReactOS PSEH compatible
1 parent 7bb9f6b commit e98e900

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+98
-0
lines changed

sdk/lib/ucrt/conio/cgets.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ extern "C" errno_t __cdecl _cgets_s(char* const source_string, size_t const size
9191
{
9292
__acrt_unlock(__acrt_conio_lock);
9393
}
94+
__endtry
9495

9596
*string++ = '\0';
9697

sdk/lib/ucrt/conio/cgetws.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ extern "C" errno_t __cdecl _cgetws_s(wchar_t* const string_buffer, size_t const
121121
{
122122
__acrt_unlock(__acrt_conio_lock);
123123
}
124+
__endtry
124125

125126
return retval;
126127
}

sdk/lib/ucrt/conio/cputs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ extern "C" int __cdecl _cputs(char const* const string)
3434
{
3535
__acrt_unlock(__acrt_conio_lock);
3636
}
37+
__endtry
3738
return result;
3839
}

sdk/lib/ucrt/conio/cputws.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ extern "C" int __cdecl _cputws(wchar_t const* string)
5858
{
5959
__acrt_unlock(__acrt_conio_lock);
6060
}
61+
__endtry
6162

6263
return result;
6364
}

sdk/lib/ucrt/conio/getch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ extern "C" int __cdecl _getch()
254254
{
255255
__acrt_unlock(__acrt_conio_lock);
256256
}
257+
__endtry
257258
return result;
258259
}
259260

@@ -269,6 +270,7 @@ extern "C" int __cdecl _getche()
269270
{
270271
__acrt_unlock(__acrt_conio_lock);
271272
}
273+
__endtry
272274
return result;
273275
}
274276

@@ -353,6 +355,7 @@ extern "C" int __cdecl _getch_nolock()
353355
// Restore the previous console mode:
354356
__dcrt_set_input_console_mode(old_console_mode);
355357
}
358+
__endtry
356359
return result;
357360
}
358361

@@ -394,6 +397,7 @@ extern "C" int __cdecl _kbhit()
394397
{
395398
__acrt_unlock(__acrt_conio_lock);
396399
}
400+
__endtry
397401
return result;
398402
}
399403

@@ -472,6 +476,7 @@ extern "C" int __cdecl _ungetch(int const c)
472476
{
473477
__acrt_unlock(__acrt_conio_lock);
474478
}
479+
__endtry
475480
return result;
476481
}
477482

sdk/lib/ucrt/conio/getwch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern "C" wint_t __cdecl _getwch()
5151
{
5252
__acrt_unlock(__acrt_conio_lock);
5353
}
54+
__endtry
5455
return result;
5556
}
5657

@@ -67,6 +68,7 @@ extern "C" wint_t __cdecl _getwche()
6768
{
6869
__acrt_unlock(__acrt_conio_lock);
6970
}
71+
__endtry
7072
return result;
7173
}
7274

@@ -140,6 +142,7 @@ extern "C" wint_t __cdecl _getwch_nolock()
140142
// Restore the previous console mode:
141143
__dcrt_set_input_console_mode(old_console_mode);
142144
}
145+
__endtry
143146
return result;
144147
}
145148

@@ -185,6 +188,7 @@ extern "C" wint_t __cdecl _ungetwch(wint_t const c)
185188
{
186189
__acrt_unlock(__acrt_conio_lock);
187190
}
191+
__endtry
188192
return result;
189193
}
190194

sdk/lib/ucrt/conio/pipe.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ extern "C" int __cdecl _pipe(int* const phandles, unsigned const psize, int cons
6161
{
6262
__acrt_lowio_unlock_fh(crt_read_handle);
6363
}
64+
__endtry
6465

6566
// Create the CRT write handle for the pipe:
6667
int const crt_write_handle = _alloc_osfhnd();
@@ -84,6 +85,7 @@ extern "C" int __cdecl _pipe(int* const phandles, unsigned const psize, int cons
8485
{
8586
__acrt_lowio_unlock_fh(crt_write_handle);
8687
}
88+
__endtry
8789

8890
// Figure out which textmode the file gets:
8991
int fmode = 0;

sdk/lib/ucrt/conio/popen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ static FILE* __cdecl common_popen(
400400
{
401401
__acrt_unlock(__acrt_popen_lock);
402402
}
403+
__endtry
403404

404405
return return_value;
405406
}
@@ -483,6 +484,7 @@ extern "C" int __cdecl _pclose(FILE* const stream)
483484
{
484485
__acrt_unlock(__acrt_popen_lock);
485486
}
487+
__endtry
486488

487489
return return_value;
488490
}

sdk/lib/ucrt/env/getenv.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static Character* __cdecl common_getenv(Character const* const name) throw()
7676
{
7777
__acrt_unlock(__acrt_environment_lock);
7878
}
79+
__endtry
7980

8081
return result;
8182
}
@@ -160,6 +161,7 @@ static errno_t __cdecl common_getenv_s(
160161
{
161162
__acrt_unlock(__acrt_environment_lock);
162163
}
164+
__endtry
163165

164166
return status;
165167
}
@@ -275,6 +277,7 @@ static errno_t __cdecl common_dupenv_s(
275277
{
276278
__acrt_unlock(__acrt_environment_lock);
277279
}
280+
__endtry
278281

279282
return status;
280283
}

sdk/lib/ucrt/env/putenv.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static int __cdecl common_putenv(
212212
{
213213
__acrt_unlock(__acrt_environment_lock);
214214
}
215+
__endtry
215216

216217
return status;
217218
}

0 commit comments

Comments
 (0)