winstuff.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. /*
  2. * winstuff.h: Windows-specific inter-module stuff.
  3. */
  4. #ifndef PUTTY_WINSTUFF_H
  5. #define PUTTY_WINSTUFF_H
  6. #ifndef AUTO_WINSOCK
  7. #include <winsock2.h>
  8. #endif
  9. #include <windows.h>
  10. #include <stdio.h> /* for FILENAME_MAX */
  11. /* We use uintptr_t for Win32/Win64 portability, so we should in
  12. * principle include stdint.h, which defines it according to the C
  13. * standard. But older versions of Visual Studio - including the one
  14. * used for official PuTTY builds as of 2015-09-28 - don't provide
  15. * stdint.h at all, but do (non-standardly) define uintptr_t in
  16. * stddef.h. So here we try to make sure _some_ standard header is
  17. * included which defines uintptr_t. */
  18. #include <stddef.h>
  19. #if !defined _MSC_VER || _MSC_VER >= 1600
  20. #include <stdint.h>
  21. #endif
  22. #include "tree234.h"
  23. #ifndef MPEXT
  24. #include "winhelp.h"
  25. #endif
  26. struct Filename {
  27. char *path;
  28. };
  29. #ifdef MPEXT
  30. FILE * mp_wfopen(const char *filename, const char *mode);
  31. #define f_open(filename, mode, isprivate) ( mp_wfopen((filename)->path, (mode)) )
  32. #else
  33. #define f_open(filename, mode, isprivate) ( fopen((filename)->path, (mode)) )
  34. #endif
  35. struct FontSpec {
  36. char *name;
  37. int isbold;
  38. int height;
  39. int charset;
  40. };
  41. struct FontSpec *fontspec_new(const char *name,
  42. int bold, int height, int charset);
  43. #ifndef CLEARTYPE_QUALITY
  44. #define CLEARTYPE_QUALITY 5
  45. #endif
  46. #define FONT_QUALITY(fq) ( \
  47. (fq) == FQ_DEFAULT ? DEFAULT_QUALITY : \
  48. (fq) == FQ_ANTIALIASED ? ANTIALIASED_QUALITY : \
  49. (fq) == FQ_NONANTIALIASED ? NONANTIALIASED_QUALITY : \
  50. CLEARTYPE_QUALITY)
  51. #define PLATFORM_IS_UTF16 /* enable UTF-16 processing when exchanging
  52. * wchar_t strings with environment */
  53. /*
  54. * Where we can, we use GetWindowLongPtr and friends because they're
  55. * more useful on 64-bit platforms, but they're a relatively recent
  56. * innovation, missing from VC++ 6 and older MinGW. Degrade nicely.
  57. * (NB that on some systems, some of these things are available but
  58. * not others...)
  59. */
  60. #ifndef GCLP_HCURSOR
  61. /* GetClassLongPtr and friends */
  62. #undef GetClassLongPtr
  63. #define GetClassLongPtr GetClassLong
  64. #undef SetClassLongPtr
  65. #define SetClassLongPtr SetClassLong
  66. #define GCLP_HCURSOR GCL_HCURSOR
  67. /* GetWindowLongPtr and friends */
  68. #undef GetWindowLongPtr
  69. #define GetWindowLongPtr GetWindowLong
  70. #undef SetWindowLongPtr
  71. #define SetWindowLongPtr SetWindowLong
  72. #undef GWLP_USERDATA
  73. #define GWLP_USERDATA GWL_USERDATA
  74. #undef DWLP_MSGRESULT
  75. #define DWLP_MSGRESULT DWL_MSGRESULT
  76. /* Since we've clobbered the above functions, we should clobber the
  77. * associated type regardless of whether it's defined. */
  78. #undef LONG_PTR
  79. #define LONG_PTR LONG
  80. #endif
  81. #define BOXFLAGS DLGWINDOWEXTRA
  82. #define BOXRESULT (DLGWINDOWEXTRA + sizeof(LONG_PTR))
  83. #define DF_END 0x0001
  84. #ifndef NO_SECUREZEROMEMORY
  85. #define PLATFORM_HAS_SMEMCLR /* inhibit cross-platform one in misc.c */
  86. #endif
  87. #define BROKEN_PIPE_ERROR_CODE ERROR_BROKEN_PIPE /* used in sshshare.c */
  88. /*
  89. * Dynamically linked functions. These come in two flavours:
  90. *
  91. * - GET_WINDOWS_FUNCTION does not expose "name" to the preprocessor,
  92. * so will always dynamically link against exactly what is specified
  93. * in "name". If you're not sure, use this one.
  94. *
  95. * - GET_WINDOWS_FUNCTION_PP allows "name" to be redirected via
  96. * preprocessor definitions like "#define foo bar"; this is principally
  97. * intended for the ANSI/Unicode DoSomething/DoSomethingA/DoSomethingW.
  98. * If your function has an argument of type "LPTSTR" or similar, this
  99. * is the variant to use.
  100. * (However, it can't always be used, as it trips over more complicated
  101. * macro trickery such as the WspiapiGetAddrInfo wrapper for getaddrinfo.)
  102. *
  103. * (DECL_WINDOWS_FUNCTION works with both these variants.)
  104. */
  105. #define DECL_WINDOWS_FUNCTION(linkage, rettype, name, params) \
  106. typedef rettype (WINAPI *t_##name) params; \
  107. linkage t_##name p_##name
  108. #define STR1(x) #x
  109. #define STR(x) STR1(x)
  110. #define GET_WINDOWS_FUNCTION_PP(module, name) \
  111. (p_##name = module ? (t_##name) GetProcAddress(module, STR(name)) : NULL)
  112. #define GET_WINDOWS_FUNCTION(module, name) \
  113. (p_##name = module ? (t_##name) GetProcAddress(module, #name) : NULL)
  114. /*
  115. * Global variables. Most modules declare these `extern', but
  116. * window.c will do `#define PUTTY_DO_GLOBALS' before including this
  117. * module, and so will get them properly defined.
  118. */
  119. #ifndef GLOBAL
  120. #ifdef PUTTY_DO_GLOBALS
  121. #define GLOBAL
  122. #else
  123. #define GLOBAL extern
  124. #endif
  125. #endif
  126. #ifndef DONE_TYPEDEFS
  127. #define DONE_TYPEDEFS
  128. typedef struct conf_tag Conf;
  129. typedef struct backend_tag Backend;
  130. typedef struct terminal_tag Terminal;
  131. #endif
  132. #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
  133. #define PUTTY_REG_PARENT "Software\\SimonTatham"
  134. #define PUTTY_REG_PARENT_CHILD "PuTTY"
  135. #define PUTTY_REG_GPARENT "Software"
  136. #define PUTTY_REG_GPARENT_CHILD "SimonTatham"
  137. /* Result values for the jumplist registry functions. */
  138. #define JUMPLISTREG_OK 0
  139. #define JUMPLISTREG_ERROR_INVALID_PARAMETER 1
  140. #define JUMPLISTREG_ERROR_KEYOPENCREATE_FAILURE 2
  141. #define JUMPLISTREG_ERROR_VALUEREAD_FAILURE 3
  142. #define JUMPLISTREG_ERROR_VALUEWRITE_FAILURE 4
  143. #define JUMPLISTREG_ERROR_INVALID_VALUE 5
  144. #define PUTTY_HELP_FILE "putty.hlp"
  145. #define PUTTY_CHM_FILE "putty.chm"
  146. #define PUTTY_HELP_CONTENTS "putty.cnt"
  147. #define GETTICKCOUNT GetTickCount
  148. #define CURSORBLINK GetCaretBlinkTime()
  149. #define TICKSPERSEC 1000 /* GetTickCount returns milliseconds */
  150. #define DEFAULT_CODEPAGE CP_ACP
  151. #define USES_VTLINE_HACK
  152. typedef HDC Context;
  153. typedef unsigned int uint32; /* int is 32-bits on Win32 and Win64. */
  154. #define PUTTY_UINT32_DEFINED
  155. #ifndef NO_GSSAPI
  156. /*
  157. * GSS-API stuff
  158. */
  159. #define GSS_CC CALLBACK
  160. /*
  161. typedef struct Ssh_gss_buf {
  162. size_t length;
  163. char *value;
  164. } Ssh_gss_buf;
  165. #define SSH_GSS_EMPTY_BUF (Ssh_gss_buf) {0,NULL}
  166. typedef void *Ssh_gss_name;
  167. */
  168. #endif
  169. /*
  170. * Window handles for the windows that can be running during a
  171. * PuTTY session.
  172. */
  173. GLOBAL HWND hwnd; /* the main terminal window */
  174. GLOBAL HWND logbox;
  175. /*
  176. * The all-important instance handle.
  177. */
  178. GLOBAL HINSTANCE hinst;
  179. /*
  180. * Help file stuff in winhelp.c.
  181. */
  182. void init_help(void);
  183. void shutdown_help(void);
  184. int has_help(void);
  185. void launch_help(HWND hwnd, const char *topic);
  186. void quit_help(HWND hwnd);
  187. /*
  188. * The terminal and logging context are notionally local to the
  189. * Windows front end, but they must be shared between window.c and
  190. * windlg.c. Likewise the saved-sessions list.
  191. */
  192. GLOBAL Terminal *term;
  193. GLOBAL void *logctx;
  194. #define WM_NETEVENT (WM_APP + 5)
  195. /*
  196. * On Windows, we send MA_2CLK as the only event marking the second
  197. * press of a mouse button. Compare unix.h.
  198. */
  199. #define MULTICLICK_ONLY_EVENT 1
  200. /*
  201. * On Windows, data written to the clipboard must be NUL-terminated.
  202. */
  203. #define SELECTION_NUL_TERMINATED 1
  204. /*
  205. * On Windows, copying to the clipboard terminates lines with CRLF.
  206. */
  207. #define SEL_NL { 13, 10 }
  208. /*
  209. * sk_getxdmdata() does not exist under Windows (not that I
  210. * couldn't write it if I wanted to, but I haven't bothered), so
  211. * it's a macro which always returns NULL. With any luck this will
  212. * cause the compiler to notice it can optimise away the
  213. * implementation of XDM-AUTHORIZATION-1 in x11fwd.c :-)
  214. */
  215. #define sk_getxdmdata(socket, lenp) (NULL)
  216. /*
  217. * File-selector filter strings used in the config box. On Windows,
  218. * these strings are of exactly the type needed to go in
  219. * `lpstrFilter' in an OPENFILENAME structure.
  220. */
  221. #define FILTER_KEY_FILES ("PuTTY Private Key Files (*.ppk)\0*.ppk\0" \
  222. "All Files (*.*)\0*\0\0\0")
  223. #define FILTER_WAVE_FILES ("Wave Files (*.wav)\0*.WAV\0" \
  224. "All Files (*.*)\0*\0\0\0")
  225. #define FILTER_DYNLIB_FILES ("Dynamic Library Files (*.dll)\0*.dll\0" \
  226. "All Files (*.*)\0*\0\0\0")
  227. /*
  228. * Exports from winnet.c.
  229. */
  230. extern int select_result(WPARAM, LPARAM);
  231. /*
  232. * winnet.c dynamically loads WinSock 2 or WinSock 1 depending on
  233. * what it can get, which means any WinSock routines used outside
  234. * that module must be exported from it as function pointers. So
  235. * here they are.
  236. */
  237. DECL_WINDOWS_FUNCTION(GLOBAL, int, WSAAsyncSelect,
  238. (SOCKET, HWND, u_int, long));
  239. DECL_WINDOWS_FUNCTION(GLOBAL, int, WSAEventSelect,
  240. (SOCKET, WSAEVENT, long));
  241. DECL_WINDOWS_FUNCTION(GLOBAL, int, select,
  242. (int, fd_set FAR *, fd_set FAR *,
  243. fd_set FAR *, const struct timeval FAR *));
  244. DECL_WINDOWS_FUNCTION(GLOBAL, int, WSAGetLastError, (void));
  245. DECL_WINDOWS_FUNCTION(GLOBAL, int, WSAEnumNetworkEvents,
  246. (SOCKET, WSAEVENT, LPWSANETWORKEVENTS));
  247. extern int socket_writable(SOCKET skt);
  248. extern void socket_reselect_all(void);
  249. /*
  250. * Exports from winctrls.c.
  251. */
  252. struct ctlpos {
  253. HWND hwnd;
  254. WPARAM font;
  255. int dlu4inpix;
  256. int ypos, width;
  257. int xoff;
  258. int boxystart, boxid;
  259. char *boxtext;
  260. };
  261. /*
  262. * Exports from winutils.c.
  263. */
  264. typedef struct filereq_tag filereq; /* cwd for file requester */
  265. BOOL request_file(filereq *state, OPENFILENAME *of, int preserve, int save);
  266. filereq *filereq_new(void);
  267. void filereq_free(filereq *state);
  268. int message_box(LPCTSTR text, LPCTSTR caption, DWORD style, DWORD helpctxid);
  269. char *GetDlgItemText_alloc(HWND hwnd, int id);
  270. void split_into_argv(char *, int *, char ***, char ***);
  271. /*
  272. * Private structure for prefslist state. Only in the header file
  273. * so that we can delegate allocation to callers.
  274. */
  275. struct prefslist {
  276. int listid, upbid, dnbid;
  277. int srcitem;
  278. int dummyitem;
  279. int dragging;
  280. };
  281. /*
  282. * This structure is passed to event handler functions as the `dlg'
  283. * parameter, and hence is passed back to winctrls access functions.
  284. */
  285. struct dlgparam {
  286. HWND hwnd; /* the hwnd of the dialog box */
  287. struct winctrls *controltrees[8]; /* can have several of these */
  288. int nctrltrees;
  289. char *wintitle; /* title of actual window */
  290. char *errtitle; /* title of error sub-messageboxes */
  291. void *data; /* data to pass in refresh events */
  292. union control *focused, *lastfocused; /* which ctrl has focus now/before */
  293. char shortcuts[128]; /* track which shortcuts in use */
  294. int coloursel_wanted; /* has an event handler asked for
  295. * a colour selector? */
  296. struct { unsigned char r, g, b, ok; } coloursel_result; /* 0-255 */
  297. tree234 *privdata; /* stores per-control private data */
  298. int ended, endresult; /* has the dialog been ended? */
  299. int fixed_pitch_fonts; /* are we constrained to fixed fonts? */
  300. };
  301. /*
  302. * Exports from winctrls.c.
  303. */
  304. void ctlposinit(struct ctlpos *cp, HWND hwnd,
  305. int leftborder, int rightborder, int topborder);
  306. HWND doctl(struct ctlpos *cp, RECT r,
  307. char *wclass, int wstyle, int exstyle, char *wtext, int wid);
  308. void bartitle(struct ctlpos *cp, char *name, int id);
  309. void beginbox(struct ctlpos *cp, char *name, int idbox);
  310. void endbox(struct ctlpos *cp);
  311. void editboxfw(struct ctlpos *cp, int password, char *text,
  312. int staticid, int editid);
  313. void radioline(struct ctlpos *cp, char *text, int id, int nacross, ...);
  314. void bareradioline(struct ctlpos *cp, int nacross, ...);
  315. void radiobig(struct ctlpos *cp, char *text, int id, ...);
  316. void checkbox(struct ctlpos *cp, char *text, int id);
  317. void statictext(struct ctlpos *cp, char *text, int lines, int id);
  318. void staticbtn(struct ctlpos *cp, char *stext, int sid,
  319. char *btext, int bid);
  320. void static2btn(struct ctlpos *cp, char *stext, int sid,
  321. char *btext1, int bid1, char *btext2, int bid2);
  322. void staticedit(struct ctlpos *cp, char *stext,
  323. int sid, int eid, int percentedit);
  324. void staticddl(struct ctlpos *cp, char *stext,
  325. int sid, int lid, int percentlist);
  326. void combobox(struct ctlpos *cp, char *text, int staticid, int listid);
  327. void staticpassedit(struct ctlpos *cp, char *stext,
  328. int sid, int eid, int percentedit);
  329. void bigeditctrl(struct ctlpos *cp, char *stext,
  330. int sid, int eid, int lines);
  331. void ersatztab(struct ctlpos *cp, char *stext, int sid, int lid, int s2id);
  332. void editbutton(struct ctlpos *cp, char *stext, int sid,
  333. int eid, char *btext, int bid);
  334. void sesssaver(struct ctlpos *cp, char *text,
  335. int staticid, int editid, int listid, ...);
  336. void envsetter(struct ctlpos *cp, char *stext, int sid,
  337. char *e1stext, int e1sid, int e1id,
  338. char *e2stext, int e2sid, int e2id,
  339. int listid, char *b1text, int b1id, char *b2text, int b2id);
  340. void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
  341. char *btext, int bid, int eid, char *s2text, int s2id);
  342. void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
  343. char *btext, int bid, ...);
  344. void prefslist(struct prefslist *hdl, struct ctlpos *cp, int lines,
  345. char *stext, int sid, int listid, int upbid, int dnbid);
  346. int handle_prefslist(struct prefslist *hdl,
  347. int *array, int maxmemb,
  348. int is_dlmsg, HWND hwnd,
  349. WPARAM wParam, LPARAM lParam);
  350. void progressbar(struct ctlpos *cp, int id);
  351. void fwdsetter(struct ctlpos *cp, int listid, char *stext, int sid,
  352. char *e1stext, int e1sid, int e1id,
  353. char *e2stext, int e2sid, int e2id,
  354. char *btext, int bid,
  355. char *r1text, int r1id, char *r2text, int r2id);
  356. void dlg_auto_set_fixed_pitch_flag(void *dlg);
  357. int dlg_get_fixed_pitch_flag(void *dlg);
  358. void dlg_set_fixed_pitch_flag(void *dlg, int flag);
  359. #define MAX_SHORTCUTS_PER_CTRL 16
  360. /*
  361. * This structure is what's stored for each `union control' in the
  362. * portable-dialog interface.
  363. */
  364. struct winctrl {
  365. union control *ctrl;
  366. /*
  367. * The control may have several components at the Windows
  368. * level, with different dialog IDs. To avoid needing N
  369. * separate platformsidectrl structures (which could be stored
  370. * separately in a tree234 so that lookup by ID worked), we
  371. * impose the constraint that those IDs must be in a contiguous
  372. * block.
  373. */
  374. int base_id;
  375. int num_ids;
  376. /*
  377. * Remember what keyboard shortcuts were used by this control,
  378. * so that when we remove it again we can take them out of the
  379. * list in the dlgparam.
  380. */
  381. char shortcuts[MAX_SHORTCUTS_PER_CTRL];
  382. /*
  383. * Some controls need a piece of allocated memory in which to
  384. * store temporary data about the control.
  385. */
  386. void *data;
  387. };
  388. /*
  389. * And this structure holds a set of the above, in two separate
  390. * tree234s so that it can find an item by `union control' or by
  391. * dialog ID.
  392. */
  393. struct winctrls {
  394. tree234 *byctrl, *byid;
  395. };
  396. struct controlset;
  397. struct controlbox;
  398. void winctrl_init(struct winctrls *);
  399. void winctrl_cleanup(struct winctrls *);
  400. void winctrl_add(struct winctrls *, struct winctrl *);
  401. void winctrl_remove(struct winctrls *, struct winctrl *);
  402. struct winctrl *winctrl_findbyctrl(struct winctrls *, union control *);
  403. struct winctrl *winctrl_findbyid(struct winctrls *, int);
  404. struct winctrl *winctrl_findbyindex(struct winctrls *, int);
  405. void winctrl_layout(struct dlgparam *dp, struct winctrls *wc,
  406. struct ctlpos *cp, struct controlset *s, int *id);
  407. int winctrl_handle_command(struct dlgparam *dp, UINT msg,
  408. WPARAM wParam, LPARAM lParam);
  409. void winctrl_rem_shortcuts(struct dlgparam *dp, struct winctrl *c);
  410. int winctrl_context_help(struct dlgparam *dp, HWND hwnd, int id);
  411. void dp_init(struct dlgparam *dp);
  412. void dp_add_tree(struct dlgparam *dp, struct winctrls *tree);
  413. void dp_cleanup(struct dlgparam *dp);
  414. /*
  415. * Exports from wincfg.c.
  416. */
  417. void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
  418. int midsession, int protocol);
  419. /*
  420. * Exports from windlg.c.
  421. */
  422. void defuse_showwindow(void);
  423. int do_config(void);
  424. int do_reconfig(HWND, int);
  425. void showeventlog(HWND);
  426. void showabout(HWND);
  427. void force_normal(HWND hwnd);
  428. void modal_about_box(HWND hwnd);
  429. void show_help(HWND hwnd);
  430. /*
  431. * Exports from winmisc.c.
  432. */
  433. extern OSVERSIONINFO osVersion;
  434. BOOL init_winver(void);
  435. HMODULE load_system32_dll(const char *libname);
  436. const char *win_strerror(int error);
  437. /*
  438. * Exports from sizetip.c.
  439. */
  440. void UpdateSizeTip(HWND src, int cx, int cy);
  441. void EnableSizeTip(int bEnable);
  442. /*
  443. * Exports from unicode.c.
  444. */
  445. struct unicode_data;
  446. void init_ucs(Conf *, struct unicode_data *);
  447. /*
  448. * Exports from winhandl.c.
  449. */
  450. #define HANDLE_FLAG_OVERLAPPED 1
  451. #define HANDLE_FLAG_IGNOREEOF 2
  452. #define HANDLE_FLAG_UNITBUFFER 4
  453. struct handle;
  454. typedef int (*handle_inputfn_t)(struct handle *h, void *data, int len);
  455. typedef void (*handle_outputfn_t)(struct handle *h, int new_backlog);
  456. struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata,
  457. void *privdata, int flags);
  458. struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata,
  459. void *privdata, int flags);
  460. int handle_write(struct handle *h, const void *data, int len);
  461. void handle_write_eof(struct handle *h);
  462. HANDLE *handle_get_events(int *nevents);
  463. void handle_free(struct handle *h);
  464. #ifdef MPEXT
  465. int handle_got_event(HANDLE event);
  466. #else
  467. void handle_got_event(HANDLE event);
  468. #endif
  469. void handle_unthrottle(struct handle *h, int backlog);
  470. int handle_backlog(struct handle *h);
  471. void *handle_get_privdata(struct handle *h);
  472. struct handle *handle_add_foreign_event(HANDLE event,
  473. void (*callback)(void *), void *ctx);
  474. /*
  475. * winpgntc.c needs to schedule callbacks for asynchronous agent
  476. * requests. This has to be done differently in GUI and console, so
  477. * there's an exported function used for the purpose.
  478. *
  479. * Also, we supply FLAG_SYNCAGENT to force agent requests to be
  480. * synchronous in pscp and psftp.
  481. */
  482. void agent_schedule_callback(void (*callback)(void *, void *, int),
  483. void *callback_ctx, void *data, int len);
  484. #define FLAG_SYNCAGENT 0x1000
  485. /*
  486. * Exports from winser.c.
  487. */
  488. extern Backend serial_backend;
  489. /*
  490. * Exports from winjump.c.
  491. */
  492. #define JUMPLIST_SUPPORTED /* suppress #defines in putty.h */
  493. void add_session_to_jumplist(const char * const sessionname);
  494. void remove_session_from_jumplist(const char * const sessionname);
  495. void clear_jumplist(void);
  496. /*
  497. * Extra functions in winstore.c over and above the interface in
  498. * storage.h.
  499. *
  500. * These functions manipulate the Registry section which mirrors the
  501. * current Windows 7 jump list. (Because the real jump list storage is
  502. * write-only, we need to keep another copy of whatever we put in it,
  503. * so that we can put in a slightly modified version the next time.)
  504. */
  505. /* Adds a saved session to the registry jump list mirror. 'item' is a
  506. * string naming a saved session. */
  507. int add_to_jumplist_registry(const char *item);
  508. /* Removes an item from the registry jump list mirror. */
  509. int remove_from_jumplist_registry(const char *item);
  510. /* Returns the current jump list entries from the registry. Caller
  511. * must free the returned pointer, which points to a contiguous
  512. * sequence of NUL-terminated strings in memory, terminated with an
  513. * empty one. */
  514. char *get_jumplist_registry_entries(void);
  515. #endif