ReactOS  0.4.13-dev-651-g5dbc677
hhctrl.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "htmlhelp.h"
#include "ole2.h"
#include "exdisp.h"
#include "mshtmhst.h"
#include "commctrl.h"
#include "wine/itss.h"
#include "wine/unicode.h"
#include "wine/heap.h"
#include "wine/list.h"
Include dependency graph for hhctrl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ChmPath
 
struct  ContentItem
 
struct  IndexSubItem
 
struct  IndexItem
 
struct  SearchItem
 
struct  CHMInfo
 
struct  HHTab
 
struct  IndexPopup
 
struct  SearchTab
 
struct  ContentsTab
 
struct  wintype_stringsW
 
struct  wintype_stringsA
 
struct  WebBrowserContainer
 
struct  HHInfo
 

Macros

#define COBJMACROS
 
#define WB_GOBACK   0
 
#define WB_GOFORWARD   1
 
#define WB_GOHOME   2
 
#define WB_SEARCH   3
 
#define WB_REFRESH   4
 
#define WB_STOP   5
 
#define WB_PRINT   6
 
#define TAB_CONTENTS   0
 
#define TAB_INDEX   1
 
#define TAB_SEARCH   2
 
#define TAB_FAVORITES   3
 
#define TAB_NUMTABS   TAB_FAVORITES
 

Typedefs

typedef struct ContentItem ContentItem
 
typedef struct IndexSubItem IndexSubItem
 
typedef struct IndexItem IndexItem
 
typedef struct SearchItem SearchItem
 
typedef struct CHMInfo CHMInfo
 

Functions

BOOL InitWebBrowser (HHInfo *, HWND) DECLSPEC_HIDDEN
 
void ReleaseWebBrowser (HHInfo *) DECLSPEC_HIDDEN
 
void ResizeWebBrowser (HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
 
void DoPageAction (WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
 
void InitContent (HHInfo *) DECLSPEC_HIDDEN
 
void ReleaseContent (HHInfo *) DECLSPEC_HIDDEN
 
void ActivateContentTopic (HWND, LPCWSTR, ContentItem *) DECLSPEC_HIDDEN
 
void InitIndex (HHInfo *) DECLSPEC_HIDDEN
 
void ReleaseIndex (HHInfo *) DECLSPEC_HIDDEN
 
CHMInfoOpenCHM (LPCWSTR szFile) DECLSPEC_HIDDEN
 
BOOL LoadWinTypeFromCHM (HHInfo *info) DECLSPEC_HIDDEN
 
CHMInfoCloseCHM (CHMInfo *pCHMInfo) DECLSPEC_HIDDEN
 
void SetChmPath (ChmPath *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
 
IStreamGetChmStream (CHMInfo *, LPCWSTR, ChmPath *) DECLSPEC_HIDDEN
 
LPWSTR FindContextAlias (CHMInfo *, DWORD) DECLSPEC_HIDDEN
 
WCHARGetDocumentTitle (CHMInfo *, LPCWSTR) DECLSPEC_HIDDEN
 
HHInfoCreateHelpViewer (HHInfo *, LPCWSTR, HWND) DECLSPEC_HIDDEN
 
void ReleaseHelpViewer (HHInfo *) DECLSPEC_HIDDEN
 
BOOL NavigateToUrl (HHInfo *, LPCWSTR) DECLSPEC_HIDDEN
 
BOOL NavigateToChm (HHInfo *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
 
void MergeChmProperties (HH_WINTYPEW *, HHInfo *, BOOL) DECLSPEC_HIDDEN
 
void UpdateHelpWindow (HHInfo *info) DECLSPEC_HIDDEN
 
void InitSearch (HHInfo *info, const char *needle) DECLSPEC_HIDDEN
 
void ReleaseSearch (HHInfo *info) DECLSPEC_HIDDEN
 
LPCWSTR skip_schema (LPCWSTR url) DECLSPEC_HIDDEN
 
void wintype_stringsA_free (struct wintype_stringsA *stringsA) DECLSPEC_HIDDEN
 
void wintype_stringsW_free (struct wintype_stringsW *stringsW) DECLSPEC_HIDDEN
 
WCHARdecode_html (const char *html_fragment, int html_fragment_len, UINT code_page) DECLSPEC_HIDDEN
 
HHInfofind_window (const WCHAR *window) DECLSPEC_HIDDEN
 
static void__WINE_ALLOC_SIZE (2) heap_realloc_zero(void *mem
 
static LPWSTR strdupW (LPCWSTR str)
 
static LPWSTR strdupnAtoW (LPCSTR str, LONG lenA)
 
static LPWSTR strdupAtoW (LPCSTR str)
 
static LPSTR strdupWtoA (LPCWSTR str)
 

Variables

struct list window_list DECLSPEC_HIDDEN
 
static void size_t len
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file hhctrl.h.

◆ TAB_CONTENTS

#define TAB_CONTENTS   0

Definition at line 116 of file hhctrl.h.

◆ TAB_FAVORITES

#define TAB_FAVORITES   3

Definition at line 119 of file hhctrl.h.

◆ TAB_INDEX

#define TAB_INDEX   1

Definition at line 117 of file hhctrl.h.

◆ TAB_NUMTABS

#define TAB_NUMTABS   TAB_FAVORITES

Definition at line 120 of file hhctrl.h.

◆ TAB_SEARCH

#define TAB_SEARCH   2

Definition at line 118 of file hhctrl.h.

◆ WB_GOBACK

#define WB_GOBACK   0

Definition at line 46 of file hhctrl.h.

◆ WB_GOFORWARD

#define WB_GOFORWARD   1

Definition at line 47 of file hhctrl.h.

◆ WB_GOHOME

#define WB_GOHOME   2

Definition at line 48 of file hhctrl.h.

◆ WB_PRINT

#define WB_PRINT   6

Definition at line 52 of file hhctrl.h.

◆ WB_REFRESH

#define WB_REFRESH   4

Definition at line 50 of file hhctrl.h.

◆ WB_SEARCH

#define WB_SEARCH   3

Definition at line 49 of file hhctrl.h.

◆ WB_STOP

#define WB_STOP   5

Definition at line 51 of file hhctrl.h.

Typedef Documentation

◆ CHMInfo

◆ ContentItem

◆ IndexItem

◆ IndexSubItem

◆ SearchItem

Function Documentation

◆ __WINE_ALLOC_SIZE()

static void* __WINE_ALLOC_SIZE ( )
inlinestatic

◆ ActivateContentTopic()

void ActivateContentTopic ( HWND  ,
LPCWSTR  ,
ContentItem  
)

Definition at line 330 of file content.c.

331 {
332  if (lstrcmpiW(item->local, filename) == 0)
333  {
335  return;
336  }
337 
338  if (item->next)
340 
341  if (item->child)
343 }
#define TVM_SELECTITEM
Definition: commctrl.h:3450
#define TVGN_CARET
Definition: commctrl.h:3433
HWND hWnd
Definition: settings.c:17
const char * filename
Definition: ioapi.h:135
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
LONG_PTR LPARAM
Definition: windef.h:208
void ActivateContentTopic(HWND hWnd, LPCWSTR filename, ContentItem *item)
Definition: content.c:330
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ActivateContentTopic(), and DoSync().

◆ CloseCHM()

CHMInfo* CloseCHM ( CHMInfo pCHMInfo)

Definition at line 663 of file chm.c.

664 {
665  if(chm->pITStorage)
666  IITStorage_Release(chm->pITStorage);
667 
668  if(chm->pStorage)
669  IStorage_Release(chm->pStorage);
670 
671  if(chm->strings_stream)
672  IStream_Release(chm->strings_stream);
673 
674  if(chm->strings_size) {
675  DWORD i;
676 
677  for(i=0; i<chm->strings_size; i++)
678  heap_free(chm->strings[i]);
679  }
680 
681  heap_free(chm->strings);
682  heap_free(chm->defWindow);
683  heap_free(chm->defTitle);
684  heap_free(chm->defTopic);
685  heap_free(chm->defToc);
686  heap_free(chm->szFile);
687  heap_free(chm->compiledFile);
688  heap_free(chm);
689 
690  return NULL;
691 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by OpenCHM(), and ReleaseHelpViewer().

◆ CreateHelpViewer()

HHInfo* CreateHelpViewer ( HHInfo ,
LPCWSTR  ,
HWND   
)

Definition at line 1819 of file help.c.

1820 {
1821  HHInfo *tmp_info;
1822  unsigned int i;
1823 
1824  if(!info)
1825  {
1826  info = heap_alloc_zero(sizeof(HHInfo));
1827  list_add_tail(&window_list, &info->entry);
1828  }
1829 
1830  /* Set the invalid tab ID (-1) as the default value for all
1831  * of the tabs, this matches a failed TCM_INSERTITEM call.
1832  */
1833  for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1834  info->tabs[i].id = -1;
1835 
1837 
1838  info->pCHMInfo = OpenCHM(filename);
1839  if(!info->pCHMInfo) {
1841  return NULL;
1842  }
1843 
1844  if (!LoadWinTypeFromCHM(info)) {
1846  return NULL;
1847  }
1848  info->WinType.hwndCaller = caller;
1849 
1850  /* If the window is already open then load the file in that existing window */
1851  if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1852  {
1854  return CreateHelpViewer(tmp_info, filename, caller);
1855  }
1856 
1857  if(!info->viewer_initialized && !CreateViewer(info)) {
1859  return NULL;
1860  }
1861 
1862  return info;
1863 }
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:619
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1819
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:341
const char * filename
Definition: ioapi.h:135
struct _test_info info[]
Definition: SetCursorPos.c:19
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:185
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1790
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:172
#define ARRAY_SIZE(a)
Definition: main.h:24
struct list window_list
Definition: help.c:51
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1955
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1717

Referenced by CreateHelpViewer(), and HtmlHelpW().

◆ decode_html()

WCHAR* decode_html ( const char html_fragment,
int  html_fragment_len,
UINT  code_page 
)

Definition at line 1890 of file help.c.

1891 {
1892  const char *h = html_fragment, *amp, *sem;
1893  char symbol, *tmp;
1894  int len, tmp_len = 0;
1895  WCHAR *unicode_text;
1896 
1897  tmp = heap_alloc(html_fragment_len+1);
1898  while(1)
1899  {
1900  symbol = 0;
1901  amp = strchr(h, '&');
1902  if(!amp) break;
1903  len = amp-h;
1904  /* Copy the characters prior to the HTML encoded character */
1905  memcpy(&tmp[tmp_len], h, len);
1906  tmp_len += len;
1907  amp++; /* skip ampersand */
1908  sem = strchr(amp, ';');
1909  /* Require a semicolon after the ampersand */
1910  if(!sem)
1911  {
1912  h = amp;
1913  tmp[tmp_len++] = '&';
1914  continue;
1915  }
1916  /* Find the symbol either by using the ANSI character number (prefixed by the pound symbol)
1917  * or by searching the HTML entity table */
1918  len = sem-amp;
1919  if(amp[0] == '#')
1920  {
1921  char *endnum = NULL;
1922  int tmp;
1923 
1924  tmp = (char) strtol(amp, &endnum, 10);
1925  if(endnum == sem)
1926  symbol = tmp;
1927  }
1928  else
1929  symbol = find_html_symbol(amp, len);
1930  if(!symbol)
1931  {
1932  FIXME("Failed to translate HTML encoded character '&%.*s;'.\n", len, amp);
1933  h = amp;
1934  tmp[tmp_len++] = '&';
1935  continue;
1936  }
1937  /* Insert the new symbol */
1938  h = sem+1;
1939  tmp[tmp_len++] = symbol;
1940  }
1941  /* Convert any remaining characters */
1942  len = html_fragment_len-(h-html_fragment);
1943  memcpy(&tmp[tmp_len], h, len);
1944  tmp_len += len;
1945  tmp[tmp_len++] = 0; /* NULL-terminate the string */
1946 
1947  len = MultiByteToWideChar(code_page, 0, tmp, tmp_len, NULL, 0);
1948  unicode_text = heap_alloc(len*sizeof(WCHAR));
1949  MultiByteToWideChar(code_page, 0, tmp, tmp_len, unicode_text, len);
1950  heap_free(tmp);
1951  return unicode_text;
1952 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static HANDLE sem
Definition: sync.c:677
#define MultiByteToWideChar
Definition: compat.h:100
char * strchr(const char *String, int ch)
Definition: utclib.c:501
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
static char find_html_symbol(const char *entity, int entity_len)
Definition: help.c:1868
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by parse_index_obj_node_param(), and parse_obj_node_param().

◆ DoPageAction()

void DoPageAction ( WebBrowserContainer ,
DWORD   
)

Definition at line 753 of file webbrowser.c.

754 {
755  if (!container || !container->web_browser)
756  return;
757 
758  switch (dwAction)
759  {
760  case WB_GOBACK:
761  IWebBrowser2_GoBack(container->web_browser);
762  break;
763  case WB_GOFORWARD:
764  IWebBrowser2_GoForward(container->web_browser);
765  break;
766  case WB_GOHOME:
767  IWebBrowser2_GoHome(container->web_browser);
768  break;
769  case WB_SEARCH:
770  IWebBrowser2_GoSearch(container->web_browser);
771  break;
772  case WB_REFRESH:
773  IWebBrowser2_Refresh(container->web_browser);
774  break;
775  case WB_STOP:
776  IWebBrowser2_Stop(container->web_browser);
777  break;
778  case WB_PRINT:
779  IWebBrowser2_ExecWB(container->web_browser, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0);
780  break;
781  }
782 }
#define WB_PRINT
Definition: hhctrl.h:52
#define WB_STOP
Definition: hhctrl.h:51
#define WB_GOBACK
Definition: hhctrl.h:46
#define WB_REFRESH
Definition: hhctrl.h:50
#define WB_GOFORWARD
Definition: hhctrl.h:47
#define WB_GOHOME
Definition: hhctrl.h:48
#define WB_SEARCH
Definition: hhctrl.h:49

Referenced by TB_OnClick(), and UI_ShowContextMenu().

◆ find_window()

HHInfo* find_window ( const WCHAR window)

Definition at line 1955 of file help.c.

1956 {
1957  HHInfo *info;
1958 
1960  {
1961  if (strcmpW(info->WinType.pszType, window) == 0)
1962  return info;
1963  }
1964  return NULL;
1965 }
struct _test_info info[]
Definition: SetCursorPos.c:19
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:185
uint32_t entry
Definition: isohybrid.c:63
static IHTMLWindow2 * window
Definition: events.c:77
struct list window_list
Definition: help.c:51
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

Referenced by CreateHelpViewer(), HtmlHelpA(), and HtmlHelpW().

◆ FindContextAlias()

LPWSTR FindContextAlias ( CHMInfo ,
DWORD   
)

Definition at line 172 of file chm.c.

173 {
174  IStream *ivb_stream;
175  DWORD size, read, i;
176  DWORD *buf;
177  LPCSTR ret = NULL;
178  HRESULT hres;
179 
180  static const WCHAR wszIVB[] = {'#','I','V','B',0};
181 
182  hres = IStorage_OpenStream(chm->pStorage, wszIVB, NULL, STGM_READ, 0, &ivb_stream);
183  if(FAILED(hres)) {
184  WARN("Could not open #IVB stream: %08x\n", hres);
185  return NULL;
186  }
187 
188  hres = IStream_Read(ivb_stream, &size, sizeof(size), &read);
189  if(FAILED(hres)) {
190  WARN("Read failed: %08x\n", hres);
191  IStream_Release(ivb_stream);
192  return NULL;
193  }
194 
195  buf = heap_alloc(size);
196  hres = IStream_Read(ivb_stream, buf, size, &read);
197  IStream_Release(ivb_stream);
198  if(FAILED(hres)) {
199  WARN("Read failed: %08x\n", hres);
200  heap_free(buf);
201  return NULL;
202  }
203 
204  size /= 2*sizeof(DWORD);
205 
206  for(i=0; i<size; i++) {
207  if(buf[2*i] == index) {
208  ret = GetChmString(chm, buf[2*i+1]);
209  break;
210  }
211  }
212 
213  heap_free(buf);
214 
215  TRACE("returning %s\n", debugstr_a(ret));
216  return strdupAtoW(ret);
217 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WARN(fmt,...)
Definition: debug.h:111
#define DWORD
Definition: nt_native.h:44
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
const char * LPCSTR
Definition: xmlstorage.h:183
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
Definition: chm.c:32
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HtmlHelpW().

◆ GetChmStream()

IStream* GetChmStream ( CHMInfo ,
LPCWSTR  ,
ChmPath  
)

Definition at line 532 of file chm.c.

533 {
534  IStorage *storage;
535  IStream *stream = NULL;
536  HRESULT hres;
537 
538  TRACE("%s (%s :: %s)\n", debugstr_w(parent_chm), debugstr_w(chm_file->chm_file),
539  debugstr_w(chm_file->chm_index));
540 
541  if(parent_chm || chm_file->chm_file) {
542  hres = IITStorage_StgOpenStorage(info->pITStorage,
543  chm_file->chm_file ? chm_file->chm_file : parent_chm, NULL,
544  STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &storage);
545  if(FAILED(hres)) {
546  WARN("Could not open storage: %08x\n", hres);
547  return NULL;
548  }
549  }else {
550  storage = info->pStorage;
551  IStorage_AddRef(info->pStorage);
552  }
553 
554  hres = IStorage_OpenStream(storage, chm_file->chm_index, NULL, STGM_READ, 0, &stream);
555  IStorage_Release(storage);
556  if(FAILED(hres))
557  WARN("Could not open stream: %08x\n", hres);
558 
559  return stream;
560 }
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:921

Referenced by InitContent(), InitIndex(), and parse_sitemap_object().

◆ GetDocumentTitle()

WCHAR* GetDocumentTitle ( CHMInfo ,
LPCWSTR   
)

Definition at line 565 of file chm.c.

566 {
567  strbuf_t node, node_name, content;
568  WCHAR *document_title = NULL;
569  IStream *str = NULL;
570  IStorage *storage;
572  HRESULT hres;
573 
574  TRACE("%s\n", debugstr_w(document));
575 
576  storage = info->pStorage;
577  if(!storage) {
578  WARN("Could not open storage to obtain the title for a document.\n");
579  return NULL;
580  }
581  IStorage_AddRef(storage);
582 
583  hres = IStorage_OpenStream(storage, document, NULL, STGM_READ, 0, &str);
584  IStorage_Release(storage);
585  if(FAILED(hres))
586  WARN("Could not open stream: %08x\n", hres);
587 
589  strbuf_init(&node);
591  strbuf_init(&node_name);
592 
593  while(next_node(&stream, &node)) {
594  get_node_name(&node, &node_name);
595 
596  TRACE("%s\n", node.buf);
597 
598  if(!strcasecmp(node_name.buf, "title")) {
599  if(next_content(&stream, &content) && content.len > 1)
600  {
601  document_title = strdupnAtoW(&content.buf[1], content.len-1);
602  FIXME("magic: %s\n", debugstr_w(document_title));
603  break;
604  }
605  }
606 
607  strbuf_zero(&node);
608  }
609 
610  strbuf_free(&node);
612  strbuf_free(&node_name);
613  IStream_Release(str);
614 
615  return document_title;
616 }
void get_node_name(strbuf_t *node, strbuf_t *name)
Definition: stream.c:88
#define strcasecmp
Definition: fake.h:9
#define WARN(fmt,...)
Definition: debug.h:111
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:268
BOOL next_node(stream_t *stream, strbuf_t *buf)
Definition: stream.c:140
struct node node
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
void strbuf_free(strbuf_t *buf)
Definition: stream.c:38
content
Definition: atl_ax.c:994
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define STGM_READ
Definition: objbase.h:916
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static void strbuf_init(strbuf *buf)
Definition: registrar.c:83
BOOL next_content(stream_t *stream, strbuf_t *buf)
Definition: stream.c:105
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
void stream_init(stream_t *stream, IStream *str)
Definition: stream.c:54
void strbuf_zero(strbuf_t *buf)
Definition: stream.c:33
Definition: dlist.c:348
char * buf
Definition: stream.h:27

Referenced by OnTopicChange().

◆ InitContent()

void InitContent ( HHInfo )

Definition at line 304 of file content.c.

305 {
306  IStream *stream;
307  insert_type_t insert_type;
308 
309  info->content = heap_alloc_zero(sizeof(ContentItem));
310  SetChmPath(&info->content->merge, info->pCHMInfo->szFile, info->WinType.pszToc);
311 
312  stream = GetChmStream(info->pCHMInfo, info->pCHMInfo->szFile, &info->content->merge);
313  if(!stream) {
314  TRACE("Could not get content stream\n");
315  return;
316  }
317 
318  info->content->child = parse_hhc(info, stream, info->content, &insert_type);
319  IStream_Release(stream);
320 
321  set_item_parents(NULL, info->content);
322  fill_content_tree(info->tabs[TAB_CONTENTS].hwnd, NULL, info->content);
323 }
#define TAB_CONTENTS
Definition: hhctrl.h:116
smooth NULL
Definition: ftsmooth.c:416
static void set_item_parents(ContentItem *parent, ContentItem *item)
Definition: content.c:295
static ContentItem * parse_hhc(HHInfo *, IStream *, ContentItem *, insert_type_t *)
Definition: content.c:229
#define TRACE(s)
Definition: solgame.cpp:4
static void fill_content_tree(HWND hwnd, ContentItem *parent, ContentItem *item)
Definition: content.c:282
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
insert_type_t
Definition: content.c:30
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:496
IStream * GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
Definition: chm.c:532

Referenced by CreateViewer().

◆ InitIndex()

void InitIndex ( HHInfo )

Definition at line 265 of file index.c.

266 {
267  IStream *stream;
268 
269  info->index = heap_alloc_zero(sizeof(IndexItem));
270  info->index->nItems = 0;
271  SetChmPath(&info->index->merge, info->pCHMInfo->szFile, info->WinType.pszIndex);
272 
273  stream = GetChmStream(info->pCHMInfo, info->pCHMInfo->szFile, &info->index->merge);
274  if(!stream) {
275  TRACE("Could not get index stream\n");
276  return;
277  }
278 
280  IStream_Release(stream);
281 
282  fill_index_tree(info->tabs[TAB_INDEX].hwnd, info->index->next);
283 }
#define TRACE(s)
Definition: solgame.cpp:4
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define TAB_INDEX
Definition: hhctrl.h:117
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:496
IStream * GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
Definition: chm.c:532
static void fill_index_tree(HWND hwnd, IndexItem *item)
Definition: index.c:28
static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
Definition: index.c:215
unsigned int index
Definition: notification.c:65

Referenced by CreateViewer().

◆ InitSearch()

void InitSearch ( HHInfo info,
const char needle 
)

Definition at line 222 of file search.c.

223 {
224  CHMInfo *chm = info->pCHMInfo;
225  SearchItem *root_item = alloc_search_item(NULL, NULL);
226 
227  SearchCHM_Storage(root_item, chm->pStorage, needle);
228  fill_search_tree(info->search.hwndList, root_item->next);
229  if(info->search.root)
231  info->search.root = root_item;
232 }
static void fill_search_tree(HWND hwndList, SearchItem *item)
Definition: search.c:47
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:97
static SearchItem * SearchCHM_Storage(SearchItem *item, IStorage *pStorage, const char *needle)
Definition: search.c:152
struct SearchItem * next
Definition: hhctrl.h:90
IStorage * pStorage
Definition: hhctrl.h:100
static SearchItem * alloc_search_item(WCHAR *title, const WCHAR *filename)
Definition: search.c:30
void ReleaseSearch(HHInfo *info)
Definition: search.c:235

Referenced by Child_WndProc().

◆ InitWebBrowser()

BOOL InitWebBrowser ( HHInfo ,
HWND   
)

Definition at line 670 of file webbrowser.c.

671 {
673  IOleInPlaceObject *inplace;
674  HRESULT hr;
675  RECT rc;
676 
677  container = heap_alloc_zero(sizeof(*container));
678  if (!container)
679  return FALSE;
680 
681  container->IOleClientSite_iface.lpVtbl = &OleClientSiteVtbl;
682  container->IOleInPlaceSite_iface.lpVtbl = &OleInPlaceSiteVtbl;
683  container->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;
684  container->IDocHostUIHandler_iface.lpVtbl = &DocHostUIHandlerVtbl;
685  container->ref = 1;
686  container->hwndWindow = hwndParent;
687 
688  info->web_browser = container;
689 
690  hr = OleCreate(&CLSID_WebBrowser, &IID_IOleObject, OLERENDER_DRAW, 0,
691  &container->IOleClientSite_iface, &MyIStorage,
692  (void **)&container->ole_obj);
693 
694  if (FAILED(hr)) goto error;
695 
697 
698  hr = OleSetContainedObject((struct IUnknown *)container->ole_obj, TRUE);
699  if (FAILED(hr)) goto error;
700 
701  hr = IOleObject_DoVerb(container->ole_obj, OLEIVERB_SHOW, NULL,
702  &container->IOleClientSite_iface, -1, hwndParent, &rc);
703  if (FAILED(hr)) goto error;
704 
705  hr = IOleObject_QueryInterface(container->ole_obj, &IID_IOleInPlaceObject, (void**)&inplace);
706  if (FAILED(hr)) goto error;
707 
708  IOleInPlaceObject_SetObjectRects(inplace, &rc, &rc);
709  IOleInPlaceObject_Release(inplace);
710 
711  hr = IOleObject_QueryInterface(container->ole_obj, &IID_IWebBrowser2, (void **)&container->web_browser);
712  if (SUCCEEDED(hr))
713  return TRUE;
714 
715 error:
717  return FALSE;
718 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
static const IOleClientSiteVtbl OleClientSiteVtbl
Definition: webbrowser.c:122
void ReleaseWebBrowser(HHInfo *info)
Definition: webbrowser.c:720
struct container container
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl
Definition: webbrowser.c:429
const GUID IID_IOleInPlaceObject
const GUID IID_IOleObject
static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
Definition: webbrowser.c:537
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
Definition: ole2.c:2612
static IStorage MyIStorage
Definition: webbrowser.c:668
HRESULT WINAPI OleSetContainedObject(LPUNKNOWN pUnknown, BOOL fContained)
Definition: ole2.c:1171
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define OLEIVERB_SHOW
Definition: ole2.h:39
static const IDocHostUIHandlerVtbl DocHostUIHandlerVtbl
Definition: webbrowser.c:296
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by HH_AddHTMLPane().

◆ LoadWinTypeFromCHM()

BOOL LoadWinTypeFromCHM ( HHInfo info)

Definition at line 341 of file chm.c.

342 {
343  LARGE_INTEGER liOffset;
344  IStorage *pStorage = info->pCHMInfo->pStorage;
345  IStream *pStream = NULL;
346  HH_WINTYPEW wintype;
347  HRESULT hr;
348  DWORD cbRead;
349  BOOL ret = FALSE;
350 
351  static const WCHAR empty[] = {0};
352  static const WCHAR toc_extW[] = {'h','h','c',0};
353  static const WCHAR index_extW[] = {'h','h','k',0};
354  static const WCHAR windowsW[] = {'#','W','I','N','D','O','W','S',0};
355 
356  /* HH_WINTYPE as stored on disk. It's identical to HH_WINTYPE except that the pointer fields
357  have been changed to DWORDs, so that the layout on 64-bit remains unchanged. */
358  struct file_wintype
359  {
360  int cbStruct;
361  BOOL fUniCodeStrings;
362  DWORD pszType;
363  DWORD fsValidMembers;
364  DWORD fsWinProperties;
365  DWORD pszCaption;
366  DWORD dwStyles;
367  DWORD dwExStyles;
368  RECT rcWindowPos;
369  int nShowState;
370  DWORD hwndHelp;
371  DWORD hwndCaller;
372  DWORD paInfoTypes;
373  DWORD hwndToolBar;
374  DWORD hwndNavigation;
375  DWORD hwndHTML;
376  int iNavWidth;
377  RECT rcHTML;
378  DWORD pszToc;
379  DWORD pszIndex;
380  DWORD pszFile;
381  DWORD pszHome;
382  DWORD fsToolBarFlags;
383  BOOL fNotExpanded;
384  int curNavType;
385  int tabpos;
386  int idNotify;
387  BYTE tabOrder[HH_MAX_TABS+1];
388  int cHistory;
389  DWORD pszJump1;
390  DWORD pszJump2;
391  DWORD pszUrlJump1;
392  DWORD pszUrlJump2;
393  RECT rcMinSize;
394  int cbInfoTypes;
395  DWORD pszCustomTabs;
396  } file_wintype;
397 
398  memset(&wintype, 0, sizeof(wintype));
399  wintype.cbStruct = sizeof(wintype);
400  wintype.fUniCodeStrings = TRUE;
401 
402  hr = IStorage_OpenStream(pStorage, windowsW, NULL, STGM_READ, 0, &pStream);
403  if (SUCCEEDED(hr))
404  {
405  /* jump past the #WINDOWS header */
406  liOffset.QuadPart = sizeof(DWORD) * 2;
407 
408  hr = IStream_Seek(pStream, liOffset, STREAM_SEEK_SET, NULL);
409  if (FAILED(hr)) goto done;
410 
411  /* read the HH_WINTYPE struct data */
412  hr = IStream_Read(pStream, &file_wintype, sizeof(file_wintype), &cbRead);
413  if (FAILED(hr)) goto done;
414 
415  /* convert the #STRINGS offsets to actual strings */
416  wintype.pszType = ConvertChmString(info, file_wintype.pszType);
417  wintype.fsValidMembers = file_wintype.fsValidMembers;
418  wintype.fsWinProperties = file_wintype.fsWinProperties;
419  wintype.pszCaption = ConvertChmString(info, file_wintype.pszCaption);
420  wintype.dwStyles = file_wintype.dwStyles;
421  wintype.dwExStyles = file_wintype.dwExStyles;
422  wintype.rcWindowPos = file_wintype.rcWindowPos;
423  wintype.nShowState = file_wintype.nShowState;
424  wintype.iNavWidth = file_wintype.iNavWidth;
425  wintype.rcHTML = file_wintype.rcHTML;
426  wintype.pszToc = ConvertChmString(info, file_wintype.pszToc);
427  wintype.pszIndex = ConvertChmString(info, file_wintype.pszIndex);
428  wintype.pszFile = ConvertChmString(info, file_wintype.pszFile);
429  wintype.pszHome = ConvertChmString(info, file_wintype.pszHome);
430  wintype.fsToolBarFlags = file_wintype.fsToolBarFlags;
431  wintype.fNotExpanded = file_wintype.fNotExpanded;
432  wintype.curNavType = file_wintype.curNavType;
433  wintype.tabpos = file_wintype.tabpos;
434  wintype.idNotify = file_wintype.idNotify;
435  memcpy(&wintype.tabOrder, file_wintype.tabOrder, sizeof(wintype.tabOrder));
436  wintype.cHistory = file_wintype.cHistory;
437  wintype.pszJump1 = ConvertChmString(info, file_wintype.pszJump1);
438  wintype.pszJump2 = ConvertChmString(info, file_wintype.pszJump2);
439  wintype.pszUrlJump1 = ConvertChmString(info, file_wintype.pszUrlJump1);
440  wintype.pszUrlJump2 = ConvertChmString(info, file_wintype.pszUrlJump2);
441  wintype.rcMinSize = file_wintype.rcMinSize;
442  wintype.cbInfoTypes = file_wintype.cbInfoTypes;
443  }
444  else
445  {
446  /* no defined window types so use (hopefully) sane defaults */
447  static const WCHAR defaultwinW[] = {'d','e','f','a','u','l','t','w','i','n','\0'};
448  wintype.pszType = strdupW(info->pCHMInfo->defWindow ? info->pCHMInfo->defWindow : defaultwinW);
449  wintype.pszToc = strdupW(info->pCHMInfo->defToc ? info->pCHMInfo->defToc : empty);
450  wintype.pszIndex = strdupW(empty);
451  wintype.fsValidMembers = 0;
453  wintype.dwStyles = WS_POPUP;
454  wintype.dwExStyles = 0;
455  wintype.nShowState = SW_SHOW;
456  wintype.curNavType = HHWIN_NAVTYPE_TOC;
457  }
458 
459  /* merge the new data with any pre-existing HH_WINTYPE structure */
460  MergeChmProperties(&wintype, info, FALSE);
461  if (!info->WinType.pszCaption)
462  info->WinType.pszCaption = info->stringsW.pszCaption = strdupW(info->pCHMInfo->defTitle ? info->pCHMInfo->defTitle : empty);
463  if (!info->WinType.pszFile)
464  info->WinType.pszFile = info->stringsW.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : empty);
465  if (!info->WinType.pszToc)
466  info->WinType.pszToc = info->stringsW.pszToc = FindHTMLHelpSetting(info, toc_extW);
467  if (!info->WinType.pszIndex)
468  info->WinType.pszIndex = info->stringsW.pszIndex = FindHTMLHelpSetting(info, index_extW);
469 
470  wintype_free(&wintype);
471  ret = TRUE;
472 
473 done:
474  if (pStream)
475  IStream_Release(pStream);
476 
477  return ret;
478 }
DWORD fsValidMembers
Definition: htmlhelp.h:343
#define TRUE
Definition: types.h:120
DWORD dwExStyles
Definition: htmlhelp.h:347
LPCWSTR pszIndex
Definition: htmlhelp.h:359
HRESULT hr
Definition: shlfolder.c:183
LPCWSTR pszType
Definition: htmlhelp.h:342
static void wintype_free(HH_WINTYPEW *wintype)
Definition: chm.c:320
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
static const WCHAR empty[]
Definition: main.c:49
BYTE tabOrder[HH_MAX_TABS+1]
Definition: htmlhelp.h:367
LPCWSTR pszCaption
Definition: htmlhelp.h:345
DWORD fsToolBarFlags
Definition: htmlhelp.h:362
#define DWORD
Definition: nt_native.h:44
BOOL fUniCodeStrings
Definition: htmlhelp.h:341
RECT rcMinSize
Definition: htmlhelp.h:373
DWORD fsWinProperties
Definition: htmlhelp.h:344
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
LPCWSTR pszToc
Definition: htmlhelp.h:358
LPCWSTR pszJump2
Definition: htmlhelp.h:370
#define STGM_READ
Definition: objbase.h:916
static WCHAR * ConvertChmString(HHInfo *info, DWORD id)
Definition: chm.c:311
LPCWSTR pszHome
Definition: htmlhelp.h:361
__wchar_t WCHAR
Definition: xmlstorage.h:180
RECT rcWindowPos
Definition: htmlhelp.h:348
void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info, BOOL override)
Definition: chm.c:253
LONG HRESULT
Definition: typedefs.h:77
LPCWSTR pszUrlJump1
Definition: htmlhelp.h:371
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HH_MAX_TABS
Definition: htmlhelp.h:260
int ret
BOOL fNotExpanded
Definition: htmlhelp.h:363
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
LPCWSTR pszFile
Definition: htmlhelp.h:360
LPCWSTR pszUrlJump2
Definition: htmlhelp.h:372
#define WS_POPUP
Definition: pedump.c:616
LPCWSTR pszJump1
Definition: htmlhelp.h:369
static WCHAR * FindHTMLHelpSetting(HHInfo *info, const WCHAR *extW)
Definition: chm.c:223
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
DWORD dwStyles
Definition: htmlhelp.h:346
#define memset(x, y, z)
Definition: compat.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by CreateHelpViewer().

◆ MergeChmProperties()

void MergeChmProperties ( HH_WINTYPEW ,
HHInfo ,
BOOL   
)

Definition at line 253 of file chm.c.

254 {
255  DWORD unhandled_params = src->fsValidMembers & ~(HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES
260  HH_WINTYPEW *dst = &info->WinType;
261  DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
262 
263  if (unhandled_params)
264  FIXME("Unsupported fsValidMembers fields: 0x%x\n", unhandled_params);
265 
266  dst->fsValidMembers |= merge;
267  if (dst->cbStruct == 0)
268  {
269  /* If the structure has not been filled in yet then use all of the values */
270  dst->cbStruct = sizeof(HH_WINTYPEW);
271  merge = ~0;
272  }
273  if (merge & HHWIN_PARAM_PROPERTIES) dst->fsWinProperties = src->fsWinProperties;
274  if (merge & HHWIN_PARAM_STYLES) dst->dwStyles = src->dwStyles;
275  if (merge & HHWIN_PARAM_EXSTYLES) dst->dwExStyles = src->dwExStyles;
276  if (merge & HHWIN_PARAM_RECT) dst->rcWindowPos = src->rcWindowPos;
277  if (merge & HHWIN_PARAM_NAV_WIDTH) dst->iNavWidth = src->iNavWidth;
278  if (merge & HHWIN_PARAM_SHOWSTATE) dst->nShowState = src->nShowState;
279  if (merge & HHWIN_PARAM_INFOTYPES) dst->paInfoTypes = src->paInfoTypes;
280  if (merge & HHWIN_PARAM_TB_FLAGS) dst->fsToolBarFlags = src->fsToolBarFlags;
281  if (merge & HHWIN_PARAM_EXPANSION) dst->fNotExpanded = src->fNotExpanded;
282  if (merge & HHWIN_PARAM_TABPOS) dst->tabpos = src->tabpos;
283  if (merge & HHWIN_PARAM_TABORDER) memcpy(dst->tabOrder, src->tabOrder, sizeof(src->tabOrder));
284  if (merge & HHWIN_PARAM_HISTORY_COUNT) dst->cHistory = src->cHistory;
285  if (merge & HHWIN_PARAM_CUR_TAB) dst->curNavType = src->curNavType;
286 
287  /*
288  * Note: We assume that hwndHelp, hwndCaller, hwndToolBar, hwndNavigation, and hwndHTML cannot be
289  * modified by the user. rcHTML and rcMinSize are not currently supported, so don't bother to copy them.
290  */
291 
292  dst->pszType = MergeChmString(src->pszType, &info->stringsW.pszType);
293  dst->pszFile = MergeChmString(src->pszFile, &info->stringsW.pszFile);
294  dst->pszToc = MergeChmString(src->pszToc, &info->stringsW.pszToc);
295  dst->pszIndex = MergeChmString(src->pszIndex, &info->stringsW.pszIndex);
296  dst->pszCaption = MergeChmString(src->pszCaption, &info->stringsW.pszCaption);
297  dst->pszHome = MergeChmString(src->pszHome, &info->stringsW.pszHome);
298  dst->pszJump1 = MergeChmString(src->pszJump1, &info->stringsW.pszJump1);
299  dst->pszJump2 = MergeChmString(src->pszJump2, &info->stringsW.pszJump2);
300  dst->pszUrlJump1 = MergeChmString(src->pszUrlJump1, &info->stringsW.pszUrlJump1);
301  dst->pszUrlJump2 = MergeChmString(src->pszUrlJump2, &info->stringsW.pszUrlJump2);
302 
303  /* FIXME: pszCustomTabs is a list of multiple zero-terminated strings so ReadString won't
304  * work in this case
305  */
306 #if 0
307  dst->pszCustomTabs = MergeChmString(src->pszCustomTabs, &info->pszCustomTabs);
308 #endif
309 }
#define HHWIN_PARAM_EXPANSION
Definition: htmlhelp.h:93
struct tagHH_WINTYPEW HH_WINTYPEW
static WCHAR * MergeChmString(LPCWSTR src, WCHAR **dst)
Definition: chm.c:246
#define HHWIN_PARAM_CUR_TAB
Definition: htmlhelp.h:97
#define HHWIN_PARAM_INFOTYPES
Definition: htmlhelp.h:91
#define HHWIN_PARAM_SHOWSTATE
Definition: htmlhelp.h:90
#define HHWIN_PARAM_NAV_WIDTH
Definition: htmlhelp.h:89
#define HHWIN_PARAM_TABORDER
Definition: htmlhelp.h:95
#define HHWIN_PARAM_TABPOS
Definition: htmlhelp.h:94
#define HHWIN_PARAM_HISTORY_COUNT
Definition: htmlhelp.h:96
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
Definition: _algo.c:1419
#define FIXME(fmt,...)
Definition: debug.h:110
#define HHWIN_PARAM_STYLES
Definition: htmlhelp.h:86
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HHWIN_PARAM_EXSTYLES
Definition: htmlhelp.h:87
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define HHWIN_PARAM_TB_FLAGS
Definition: htmlhelp.h:92
GLenum src
Definition: glext.h:6340
#define HHWIN_PARAM_PROPERTIES
Definition: htmlhelp.h:85
GLenum GLenum dst
Definition: glext.h:6340
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88

Referenced by HtmlHelpW(), and LoadWinTypeFromCHM().

◆ NavigateToChm()

BOOL NavigateToChm ( HHInfo ,
LPCWSTR  ,
LPCWSTR   
)

Definition at line 253 of file help.c.

254 {
256 
257  TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
258 
259  if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
260  return FALSE;
261 
262  return SUCCEEDED(navigate_url(info, buf));
263 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:234
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:189
#define debugstr_w
Definition: kernel32.h:32
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1380
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: fci.c:126

Referenced by HtmlHelpW(), NavigateToUrl(), OnTopicChange(), PopupChild_WndProc(), and TB_OnClick().

◆ NavigateToUrl()

BOOL NavigateToUrl ( HHInfo ,
LPCWSTR   
)

Definition at line 209 of file help.c.

210 {
211  ChmPath chm_path;
212  BOOL ret;
213  HRESULT hres;
214 
215  static const WCHAR url_indicator[] = {':', '/', '/', 0};
216 
217  TRACE("%s\n", debugstr_w(surl));
218 
219  if (strstrW(surl, url_indicator)) {
220  hres = navigate_url(info, surl);
221  if(SUCCEEDED(hres))
222  return TRUE;
223  } /* look up in chm if it doesn't look like a full url */
224 
225  SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
226  ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
227 
228  heap_free(chm_path.chm_file);
229  heap_free(chm_path.chm_index);
230 
231  return ret;
232 }
#define TRUE
Definition: types.h:120
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:189
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
LPWSTR chm_index
Definition: hhctrl.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define strstrW(d, s)
Definition: unicode.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LPWSTR chm_file
Definition: hhctrl.h:55
int ret
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:496
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: hhctrl.h:54

Referenced by HtmlHelpW().

◆ OpenCHM()

CHMInfo* OpenCHM ( LPCWSTR  szFile)

Definition at line 619 of file chm.c.

620 {
621  HRESULT hres;
622  CHMInfo *ret;
623 
624  static const WCHAR wszSTRINGS[] = {'#','S','T','R','I','N','G','S',0};
625 
626  if (!(ret = heap_alloc_zero(sizeof(CHMInfo))))
627  return NULL;
628  ret->codePage = CP_ACP;
629 
630  if (!(ret->szFile = strdupW(szFile))) {
631  heap_free(ret);
632  return NULL;
633  }
634 
635  hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
636  &IID_IITStorage, (void **) &ret->pITStorage) ;
637  if(FAILED(hres)) {
638  WARN("Could not create ITStorage: %08x\n", hres);
639  return CloseCHM(ret);
640  }
641 
642  hres = IITStorage_StgOpenStorage(ret->pITStorage, szFile, NULL,
643  STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &ret->pStorage);
644  if(FAILED(hres)) {
645  WARN("Could not open storage: %08x\n", hres);
646  return CloseCHM(ret);
647  }
648  hres = IStorage_OpenStream(ret->pStorage, wszSTRINGS, NULL, STGM_READ, 0,
649  &ret->strings_stream);
650  if(FAILED(hres)) {
651  WARN("Could not open #STRINGS stream: %08x\n", hres);
652  /* It's not critical, so we pass */
653  }
654 
655  if(!ReadChmSystem(ret)) {
656  WARN("Could not read #SYSTEM\n");
657  return CloseCHM(ret);
658  }
659 
660  return ret;
661 }
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:97
#define STGM_READ
Definition: objbase.h:916
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:663
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:921
static BOOL ReadChmSystem(CHMInfo *chm)
Definition: chm.c:79
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by CreateHelpViewer().

◆ ReleaseContent()

void ReleaseContent ( HHInfo )

Definition at line 325 of file content.c.

326 {
327  free_content_item(info->content);
328 }
static void free_content_item(ContentItem *item)
Definition: content.c:35

Referenced by ReleaseHelpViewer().

◆ ReleaseHelpViewer()

void ReleaseHelpViewer ( HHInfo )

Definition at line 1790 of file help.c.

1791 {
1792  TRACE("(%p)\n", info);
1793 
1794  if (!info)
1795  return;
1796 
1797  list_remove(&info->entry);
1798 
1799  wintype_stringsA_free(&info->stringsA);
1800  wintype_stringsW_free(&info->stringsW);
1801 
1802  if (info->pCHMInfo)
1803  CloseCHM(info->pCHMInfo);
1804 
1807  ReleaseIndex(info);
1809 
1810  if(info->contents.hImageList)
1811  ImageList_Destroy(info->contents.hImageList);
1812  if(info->WinType.hwndHelp)
1813  DestroyWindow(info->WinType.hwndHelp);
1814 
1815  heap_free(info);
1816  OleUninitialize();
1817 }
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1761
void ReleaseContent(HHInfo *info)
Definition: content.c:325
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:925
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1775
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:663
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by CreateHelpViewer(), Help_WndProc(), and HtmlHelpW().

◆ ReleaseIndex()

void ReleaseIndex ( HHInfo )

Definition at line 288 of file index.c.

289 {
290  IndexItem *item = info->index, *next;
291  int i;
292 
293  if(!item) return;
294  /* Note: item->merge is identical for all items, only free once */
295  heap_free(item->merge.chm_file);
296  heap_free(item->merge.chm_index);
297  while(item) {
298  next = item->next;
299 
300  heap_free(item->keyword);
301  for(i=0;i<item->nItems;i++) {
302  heap_free(item->items[i].name);
303  heap_free(item->items[i].local);
304  }
305  heap_free(item->items);
306 
307  item = next;
308  }
309 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static unsigned __int64 next
Definition: rand_nt.c:6
static ATOM item
Definition: dde.c:856
unsigned int index
Definition: notification.c:65
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ReleaseHelpViewer().

◆ ReleaseSearch()

void ReleaseSearch ( HHInfo info)

Definition at line 235 of file search.c.

236 {
237  SearchItem *item = info->search.root;
238 
239  info->search.root = NULL;
240  while(item) {
241  heap_free(item->filename);
242  item = item->next;
243  }
244 }
smooth NULL
Definition: ftsmooth.c:416
static ATOM item
Definition: dde.c:856
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by InitSearch(), and ReleaseHelpViewer().

◆ ReleaseWebBrowser()

void ReleaseWebBrowser ( HHInfo )

Definition at line 720 of file webbrowser.c.

721 {
722  WebBrowserContainer *container = info->web_browser;
723  HRESULT hres;
724 
725  if(!container)
726  return;
727 
728  if(container->ole_obj) {
729  IOleInPlaceSite *inplace;
730 
731  hres = IOleObject_QueryInterface(container->ole_obj, &IID_IOleInPlaceSite, (void**)&inplace);
732  if(SUCCEEDED(hres)) {
733  IOleInPlaceSite_OnInPlaceDeactivate(inplace);
734  IOleInPlaceSite_Release(inplace);
735  }
736 
737  IOleObject_SetClientSite(container->ole_obj, NULL);
738  }
739 
740  info->web_browser = NULL;
741  IOleClientSite_Release(&container->IOleClientSite_iface);
742 }
const GUID IID_IOleInPlaceSite
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by InitWebBrowser(), and ReleaseHelpViewer().

◆ ResizeWebBrowser()

void ResizeWebBrowser ( HHInfo ,
DWORD  ,
DWORD   
)

Definition at line 744 of file webbrowser.c.

745 {
746  if (!info->web_browser)
747  return;
748 
749  IWebBrowser2_put_Width(info->web_browser->web_browser, dwWidth);
750  IWebBrowser2_put_Height(info->web_browser->web_browser, dwHeight);
751 }
static const WCHAR dwHeight[]
Definition: provider.c:60
static const WCHAR dwWidth[]
Definition: provider.c:59

Referenced by Help_OnSize().

◆ SetChmPath()

void SetChmPath ( ChmPath ,
LPCWSTR  ,
LPCWSTR   
)

Definition at line 496 of file chm.c.

497 {
498  LPCWSTR ptr;
499  static const WCHAR separatorW[] = {':',':',0};
500 
501  path = skip_schema(path);
502 
504  if(ptr) {
505  WCHAR chm_file[MAX_PATH];
506  WCHAR rel_path[MAX_PATH];
507  WCHAR base_path[MAX_PATH];
508  LPWSTR p;
509 
510  strcpyW(base_path, base_file);
511  p = strrchrW(base_path, '\\');
512  if(p)
513  *p = 0;
514 
515  memcpy(rel_path, path, (ptr-path)*sizeof(WCHAR));
516  rel_path[ptr-path] = 0;
517 
518  PathCombineW(chm_file, base_path, rel_path);
519 
520  file->chm_file = strdupW(chm_file);
521  ptr += 2;
522  }else {
523  file->chm_file = strdupW(base_file);
524  ptr = path;
525  }
526 
527  file->chm_index = strdupW(ptr);
528 
529  TRACE("ChmFile = {%s %s}\n", debugstr_w(file->chm_file), debugstr_w(file->chm_index));
530 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLsizei const GLchar ** path
Definition: glext.h:7234
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
#define strstrW(d, s)
Definition: unicode.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR separatorW[]
Definition: itemdlg.c:1561
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
Definition: services.c:325
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:189
LPCWSTR skip_schema(LPCWSTR url)
Definition: chm.c:480
Definition: fci.c:126

Referenced by InitContent(), InitIndex(), NavigateToUrl(), and parse_obj_node_param().

◆ skip_schema()

LPCWSTR skip_schema ( LPCWSTR  url)

Definition at line 480 of file chm.c.

481 {
482  static const WCHAR its_schema[] = {'i','t','s',':'};
483  static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
484  static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
485 
486  if(!strncmpiW(its_schema, url, ARRAY_SIZE(its_schema)))
487  return url + ARRAY_SIZE(its_schema);
488  if(!strncmpiW(msits_schema, url, ARRAY_SIZE(msits_schema)))
489  return url + ARRAY_SIZE(msits_schema);
490  if(!strncmpiW(mk_schema, url, ARRAY_SIZE(mk_schema)))
491  return url + ARRAY_SIZE(mk_schema);
492 
493  return url;
494 }
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR url[]
Definition: encode.c:1432
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by resolve_filename(), and SetChmPath().

◆ strdupAtoW()

static LPWSTR strdupAtoW ( LPCSTR  str)
inlinestatic

Definition at line 291 of file hhctrl.h.

292 {
293  return strdupnAtoW(str, -1);
294 }
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:268
const WCHAR * str

◆ strdupnAtoW()

static LPWSTR strdupnAtoW ( LPCSTR  str,
LONG  lenA 
)
inlinestatic

Definition at line 268 of file hhctrl.h.

269 {
270  LPWSTR ret;
271  DWORD len;
272 
273  if(!str)
274  return NULL;
275 
276  if (lenA > 0)
277  {
278  /* find length of string */
279  LPCSTR eos = memchr(str, 0, lenA);
280  if (eos) lenA = eos - str;
281  }
282 
283  len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
284  ret = heap_alloc(len*sizeof(WCHAR));
285  MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
286  ret[len-1] = 0;
287 
288  return ret;
289 }
#define memchr(s, c, n)
Definition: mkisofs.h:875
#define CP_ACP
Definition: compat.h:99
static void size_t len
Definition: hhctrl.h:249
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by GetDocumentTitle(), ReadChmSystem(), and strdupAtoW().

◆ strdupW()

static LPWSTR strdupW ( LPCWSTR  str)
inlinestatic

Definition at line 253 of file hhctrl.h.

254 {
255  LPWSTR ret;
256  int size;
257 
258  if(!str)
259  return NULL;
260 
261  size = (strlenW(str)+1)*sizeof(WCHAR);
262  ret = heap_alloc(size);
263  memcpy(ret, str, size);
264 
265  return ret;
266 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ strdupWtoA()

static LPSTR strdupWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 296 of file hhctrl.h.

297 {
298  LPSTR ret;
299  DWORD len;
300 
301  if(!str)
302  return NULL;
303 
304  len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
305  ret = heap_alloc(len);
307  return ret;
308 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
static void size_t len
Definition: hhctrl.h:249
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722

Referenced by ACTION_CallDllFunction(), cabinet_next_cabinet(), extract_cabinet(), ITERATE_BindImage(), msi_scrolltext_add_text(), and wintypeWtoA().

◆ UpdateHelpWindow()

void UpdateHelpWindow ( HHInfo info)

Definition at line 1559 of file help.c.

1560 {
1561  if (!info->WinType.hwndHelp)
1562  return;
1563 
1564  WARN("Only the size of the window is currently updated.\n");
1565  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1566  {
1567  RECT *rect = &info->WinType.rcWindowPos;
1568  INT x, y, width, height;
1569 
1570  x = rect->left;
1571  y = rect->top;
1572  width = rect->right - x;
1573  height = rect->bottom - y;
1574  SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1576  }
1577 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1232
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
smooth NULL
Definition: ftsmooth.c:416
#define SWP_NOACTIVATE
Definition: winuser.h:1227
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by HtmlHelpW().

◆ wintype_stringsA_free()

void wintype_stringsA_free ( struct wintype_stringsA stringsA)

Definition at line 1775 of file help.c.

1776 {
1777  heap_free(stringsA->pszType);
1778  heap_free(stringsA->pszCaption);
1779  heap_free(stringsA->pszToc);
1780  heap_free(stringsA->pszIndex);
1781  heap_free(stringsA->pszFile);
1782  heap_free(stringsA->pszHome);
1783  heap_free(stringsA->pszJump1);
1784  heap_free(stringsA->pszJump2);
1785  heap_free(stringsA->pszUrlJump1);
1786  heap_free(stringsA->pszUrlJump2);
1787  heap_free(stringsA->pszCustomTabs);
1788 }
char * pszToc
Definition: hhctrl.h:161
char * pszUrlJump1
Definition: hhctrl.h:167
char * pszCaption
Definition: hhctrl.h:160
char * pszJump1
Definition: hhctrl.h:165
char * pszCustomTabs
Definition: hhctrl.h:169
char * pszJump2
Definition: hhctrl.h:166
char * pszType
Definition: hhctrl.h:159
char * pszUrlJump2
Definition: hhctrl.h:168
char * pszFile
Definition: hhctrl.h:163
char * pszIndex
Definition: hhctrl.h:162
char * pszHome
Definition: hhctrl.h:164
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

◆ wintype_stringsW_free()

void wintype_stringsW_free ( struct wintype_stringsW stringsW)

Definition at line 1761 of file help.c.

1762 {
1763  heap_free(stringsW->pszType);
1764  heap_free(stringsW->pszCaption);
1765  heap_free(stringsW->pszToc);
1766  heap_free(stringsW->pszIndex);
1767  heap_free(stringsW->pszFile);
1768  heap_free(stringsW->pszHome);
1769  heap_free(stringsW->pszJump1);
1770  heap_free(stringsW->pszJump2);
1771  heap_free(stringsW->pszUrlJump1);
1772  heap_free(stringsW->pszUrlJump2);
1773 }
WCHAR * pszJump1
Definition: hhctrl.h:151
WCHAR * pszType
Definition: hhctrl.h:145
WCHAR * pszJump2
Definition: hhctrl.h:152
WCHAR * pszToc
Definition: hhctrl.h:147
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
WCHAR * pszHome
Definition: hhctrl.h:150
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * pszIndex
Definition: hhctrl.h:148
WCHAR * pszFile
Definition: hhctrl.h:149
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
WCHAR * pszCaption
Definition: hhctrl.h:146

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

Variable Documentation

◆ DECLSPEC_HIDDEN

BOOL hh_process DECLSPEC_HIDDEN

Definition at line 311 of file hhctrl.h.

◆ len

Initial value:
{
#define GetProcessHeap()
Definition: compat.h:395
GLenum GLsizei len
Definition: glext.h:6722
#define HeapReAlloc
Definition: compat.h:393
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: mem.c:156

Definition at line 249 of file hhctrl.h.

Referenced by strdupnAtoW(), and strdupWtoA().