tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

exdll.cpp (843B)


      1 // This Source Code Form is subject to the terms of the Mozilla Public
      2 // License, v. 2.0.If a copy of the MPL was not distributed with this
      3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 #include "exdll.h"
      6 
      7 unsigned int g_stringsize;
      8 stack_t** g_stacktop;
      9 int(__stdcall* g_executeCodeSegment)(int pos, HWND hwndProgress);
     10 HWND g_hwndParent;
     11 
     12 int popstring(TCHAR* str) {
     13  stack_t* th;
     14  if (!g_stacktop || !*g_stacktop) return 1;
     15  th = (*g_stacktop);
     16  lstrcpy(str, th->text);
     17  *g_stacktop = th->next;
     18  GlobalFree((HGLOBAL)th);
     19  return 0;
     20 }
     21 
     22 void pushstring(const TCHAR* str) {
     23  stack_t* th;
     24  if (!g_stacktop) return;
     25  th = (stack_t*)GlobalAlloc(GPTR,
     26                             sizeof(stack_t) + (g_stringsize * sizeof(TCHAR)));
     27  lstrcpyn(th->text, str, g_stringsize);
     28  th->next = *g_stacktop;
     29  *g_stacktop = th;
     30 }