ReactOS  0.4.15-dev-5499-g1341c38
hhctrl.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/winternl.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/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:3478
#define TVGN_CARET
Definition: commctrl.h:3461
HWND hWnd
Definition: settings.c:17
const char * filename
Definition: ioapi.h:137
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 670 of file chm.c.

671 {
672  if(chm->pITStorage)
673  IITStorage_Release(chm->pITStorage);
674 
675  if(chm->pStorage)
676  IStorage_Release(chm->pStorage);
677 
678  if(chm->strings_stream)
679  IStream_Release(chm->strings_stream);
680 
681  if(chm->strings_size) {
682  DWORD i;
683 
684  for(i=0; i<chm->strings_size; i++)
685  heap_free(chm->strings[i]);
686  }
687 
688  heap_free(chm->strings);
689  heap_free(chm->defWindow);
690  heap_free(chm->defTitle);
691  heap_free(chm->defTopic);
692  heap_free(chm->defToc);
693  heap_free(chm->szFile);
694  heap_free(chm->compiledFile);
695  heap_free(chm);
696 
697  return NULL;
698 }
unsigned long DWORD
Definition: ntddk_ex.h:95
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
#define NULL
Definition: types.h:112
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by OpenCHM(), and ReleaseHelpViewer().

◆ CreateHelpViewer()

HHInfo* CreateHelpViewer ( HHInfo ,
LPCWSTR  ,
HWND   
)

Definition at line 1844 of file help.c.

1845 {
1846  HHInfo *tmp_info;
1847  unsigned int i;
1848 
1849  if(!info)
1850  {
1851  info = heap_alloc_zero(sizeof(HHInfo));
1852  list_add_tail(&window_list, &info->entry);
1853  }
1854 
1855  /* Set the invalid tab ID (-1) as the default value for all
1856  * of the tabs, this matches a failed TCM_INSERTITEM call.
1857  */
1858  for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1859  info->tabs[i].id = -1;
1860 
1862 
1863  info->pCHMInfo = OpenCHM(filename);
1864  if(!info->pCHMInfo) {
1866  return NULL;
1867  }
1868 
1869  if (!LoadWinTypeFromCHM(info)) {
1871  return NULL;
1872  }
1873  info->WinType.hwndCaller = caller;
1874 
1875  /* If the window is already open then load the file in that existing window */
1876  if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1877  {
1879  return CreateHelpViewer(tmp_info, filename, caller);
1880  }
1881 
1882  if(!info->viewer_initialized && !CreateViewer(info)) {
1884  return NULL;
1885  }
1886 
1887  return info;
1888 }
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:626
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1844
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:344
const char * filename
Definition: ioapi.h:137
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
static struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: hhctrl.h:185
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1815
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
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
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct list window_list
Definition: help.c:51
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1980
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1742

Referenced by CreateHelpViewer(), and HtmlHelpW().

◆ decode_html()

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

Definition at line 1915 of file help.c.

1916 {
1917  const char *h = html_fragment, *amp, *sem;
1918  char symbol, *tmp;
1919  int len, tmp_len = 0;
1920  WCHAR *unicode_text;
1921 
1922  tmp = heap_alloc(html_fragment_len+1);
1923  while(1)
1924  {
1925  symbol = 0;
1926  amp = strchr(h, '&');
1927  if(!amp) break;
1928  len = amp-h;
1929  /* Copy the characters prior to the HTML encoded character */
1930  memcpy(&tmp[tmp_len], h, len);
1931  tmp_len += len;
1932  amp++; /* skip ampersand */
1933  sem = strchr(amp, ';');
1934  /* Require a semicolon after the ampersand */
1935  if(!sem)
1936  {
1937  h = amp;
1938  tmp[tmp_len++] = '&';
1939  continue;
1940  }
1941  /* Find the symbol either by using the ANSI character number (prefixed by the pound symbol)
1942  * or by searching the HTML entity table */
1943  len = sem-amp;
1944  if(amp[0] == '#')
1945  {
1946  char *endnum = NULL;
1947  int tmp;
1948 
1949  tmp = (char) strtol(amp, &endnum, 10);
1950  if(endnum == sem)
1951  symbol = tmp;
1952  }
1953  else
1954  symbol = find_html_symbol(amp, len);
1955  if(!symbol)
1956  {
1957  FIXME("Failed to translate HTML encoded character '&%.*s;'.\n", len, amp);
1958  h = amp;
1959  tmp[tmp_len++] = '&';
1960  continue;
1961  }
1962  /* Insert the new symbol */
1963  h = sem+1;
1964  tmp[tmp_len++] = symbol;
1965  }
1966  /* Convert any remaining characters */
1967  len = html_fragment_len-(h-html_fragment);
1968  memcpy(&tmp[tmp_len], h, len);
1969  tmp_len += len;
1970  tmp[tmp_len++] = 0; /* NULL-terminate the string */
1971 
1972  len = MultiByteToWideChar(code_page, 0, tmp, tmp_len, NULL, 0);
1973  unicode_text = heap_alloc(len*sizeof(WCHAR));
1974  MultiByteToWideChar(code_page, 0, tmp, tmp_len, unicode_text, len);
1975  heap_free(tmp);
1976  return unicode_text;
1977 }
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:111
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:674
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
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:1893
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 1980 of file help.c.

1981 {
1982  HHInfo *info;
1983 
1985  {
1986  if (lstrcmpW(info->WinType.pszType, window) == 0)
1987  return info;
1988  }
1989  return NULL;
1990 }
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: hhctrl.h:185
uint32_t entry
Definition: isohybrid.c:63
static IHTMLWindow2 * window
Definition: events.c:77
#define NULL
Definition: types.h:112
struct list window_list
Definition: help.c:51

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

◆ FindContextAlias()

LPWSTR FindContextAlias ( CHMInfo ,
DWORD   
)

Definition at line 175 of file chm.c.

176 {
177  IStream *ivb_stream;
178  DWORD size, read, i;
179  DWORD *buf;
180  LPCSTR ret = NULL;
181  HRESULT hres;
182 
183  static const WCHAR wszIVB[] = {'#','I','V','B',0};
184 
185  hres = IStorage_OpenStream(chm->pStorage, wszIVB, NULL, STGM_READ, 0, &ivb_stream);
186  if(FAILED(hres)) {
187  WARN("Could not open #IVB stream: %08x\n", hres);
188  return NULL;
189  }
190 
191  hres = IStream_Read(ivb_stream, &size, sizeof(size), &read);
192  if(FAILED(hres)) {
193  WARN("Read failed: %08x\n", hres);
194  IStream_Release(ivb_stream);
195  return NULL;
196  }
197 
198  buf = heap_alloc(size);
199  hres = IStream_Read(ivb_stream, buf, size, &read);
200  IStream_Release(ivb_stream);
201  if(FAILED(hres)) {
202  WARN("Read failed: %08x\n", hres);
203  heap_free(buf);
204  return NULL;
205  }
206 
207  size /= 2*sizeof(DWORD);
208 
209  for(i=0; i<size; i++) {
210  if(buf[2*i] == index) {
211  ret = GetChmString(chm, buf[2*i+1]);
212  break;
213  }
214  }
215 
216  heap_free(buf);
217 
218  TRACE("returning %s\n", debugstr_a(ret));
219  return strdupAtoW(ret);
220 }
#define WARN(fmt,...)
Definition: debug.h:112
#define DWORD
Definition: nt_native.h:44
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint index
Definition: glext.h:6031
const char * LPCSTR
Definition: xmlstorage.h:183
#define STGM_READ
Definition: objbase.h:917
#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:79
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
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 LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
Definition: chm.c:35
#define NULL
Definition: types.h:112
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
_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 539 of file chm.c.

540 {
541  IStorage *storage;
542  IStream *stream = NULL;
543  HRESULT hres;
544 
545  TRACE("%s (%s :: %s)\n", debugstr_w(parent_chm), debugstr_w(chm_file->chm_file),
546  debugstr_w(chm_file->chm_index));
547 
548  if(parent_chm || chm_file->chm_file) {
549  hres = IITStorage_StgOpenStorage(info->pITStorage,
550  chm_file->chm_file ? chm_file->chm_file : parent_chm, NULL,
551  STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &storage);
552  if(FAILED(hres)) {
553  WARN("Could not open storage: %08x\n", hres);
554  return NULL;
555  }
556  }else {
557  storage = info->pStorage;
558  IStorage_AddRef(info->pStorage);
559  }
560 
561  hres = IStorage_OpenStream(storage, chm_file->chm_index, NULL, STGM_READ, 0, &stream);
562  IStorage_Release(storage);
563  if(FAILED(hres))
564  WARN("Could not open stream: %08x\n", hres);
565 
566  return stream;
567 }
#define WARN(fmt,...)
Definition: debug.h:112
#define debugstr_w
Definition: kernel32.h:32
#define STGM_READ
Definition: objbase.h:917
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define NULL
Definition: types.h:112
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922

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

◆ GetDocumentTitle()

WCHAR* GetDocumentTitle ( CHMInfo ,
LPCWSTR   
)

Definition at line 572 of file chm.c.

573 {
574  strbuf_t node, node_name, content;
575  WCHAR *document_title = NULL;
576  IStream *str = NULL;
577  IStorage *storage;
579  HRESULT hres;
580 
581  TRACE("%s\n", debugstr_w(document));
582 
583  storage = info->pStorage;
584  if(!storage) {
585  WARN("Could not open storage to obtain the title for a document.\n");
586  return NULL;
587  }
588  IStorage_AddRef(storage);
589 
590  hres = IStorage_OpenStream(storage, document, NULL, STGM_READ, 0, &str);
591  IStorage_Release(storage);
592  if(FAILED(hres))
593  WARN("Could not open stream: %08x\n", hres);
594 
596  strbuf_init(&node);
598  strbuf_init(&node_name);
599 
600  while(next_node(&stream, &node)) {
601  get_node_name(&node, &node_name);
602 
603  TRACE("%s\n", node.buf);
604 
605  if(!_strnicmp(node_name.buf, "title", -1)) {
606  if(next_content(&stream, &content) && content.len > 1)
607  {
608  document_title = strdupnAtoW(&content.buf[1], content.len-1);
609  FIXME("magic: %s\n", debugstr_w(document_title));
610  break;
611  }
612  }
613 
614  strbuf_zero(&node);
615  }
616 
617  strbuf_free(&node);
619  strbuf_free(&node_name);
620  IStream_Release(str);
621 
622  return document_title;
623 }
void get_node_name(strbuf_t *node, strbuf_t *name)
Definition: stream.c:88
#define WARN(fmt,...)
Definition: debug.h:112
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:271
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:111
void strbuf_free(strbuf_t *buf)
Definition: stream.c:38
content
Definition: atl_ax.c:993
const WCHAR * str
#define STGM_READ
Definition: objbase.h:917
#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:79
static void strbuf_init(strbuf *buf)
Definition: registrar.c:82
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
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
#define NULL
Definition: types.h:112
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
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:503
#define NULL
Definition: types.h:112
IStream * GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
Definition: chm.c:539

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:503
IStream * GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
Definition: chm.c:539
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
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
#define NULL
Definition: types.h:112

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 }
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define TRUE
Definition: types.h:120
static const IOleClientSiteVtbl OleClientSiteVtbl
Definition: webbrowser.c:122
void ReleaseWebBrowser(HHInfo *info)
Definition: webbrowser.c:720
struct container container
#define FALSE
Definition: types.h:117
if SUCCEEDED(hr)
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:79
HRESULT WINAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID *ppvObj)
Definition: ole2.c:2609
static IStorage MyIStorage
Definition: webbrowser.c:668
HRESULT WINAPI OleSetContainedObject(LPUNKNOWN pUnknown, BOOL fContained)
Definition: ole2.c:1168
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define NULL
Definition: types.h:112
#define OLEIVERB_SHOW
Definition: ole2.h:39
static const IDocHostUIHandlerVtbl DocHostUIHandlerVtbl
Definition: webbrowser.c:296

Referenced by HH_AddHTMLPane().

◆ LoadWinTypeFromCHM()

BOOL LoadWinTypeFromCHM ( HHInfo info)

Definition at line 344 of file chm.c.

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

Referenced by CreateHelpViewer().

◆ MergeChmProperties()

void MergeChmProperties ( HH_WINTYPEW ,
HHInfo ,
BOOL   
)

Definition at line 256 of file chm.c.

257 {
258  DWORD unhandled_params = src->fsValidMembers & ~(HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES
263  HH_WINTYPEW *dst = &info->WinType;
264  DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
265 
266  if (unhandled_params)
267  FIXME("Unsupported fsValidMembers fields: 0x%x\n", unhandled_params);
268 
269  dst->fsValidMembers |= merge;
270  if (dst->cbStruct == 0)
271  {
272  /* If the structure has not been filled in yet then use all of the values */
273  dst->cbStruct = sizeof(HH_WINTYPEW);
274  merge = ~0;
275  }
276  if (merge & HHWIN_PARAM_PROPERTIES) dst->fsWinProperties = src->fsWinProperties;
277  if (merge & HHWIN_PARAM_STYLES) dst->dwStyles = src->dwStyles;
278  if (merge & HHWIN_PARAM_EXSTYLES) dst->dwExStyles = src->dwExStyles;
279  if (merge & HHWIN_PARAM_RECT) dst->rcWindowPos = src->rcWindowPos;
280  if (merge & HHWIN_PARAM_NAV_WIDTH) dst->iNavWidth = src->iNavWidth;
281  if (merge & HHWIN_PARAM_SHOWSTATE) dst->nShowState = src->nShowState;
282  if (merge & HHWIN_PARAM_INFOTYPES) dst->paInfoTypes = src->paInfoTypes;
283  if (merge & HHWIN_PARAM_TB_FLAGS) dst->fsToolBarFlags = src->fsToolBarFlags;
284  if (merge & HHWIN_PARAM_EXPANSION) dst->fNotExpanded = src->fNotExpanded;
285  if (merge & HHWIN_PARAM_TABPOS) dst->tabpos = src->tabpos;
286  if (merge & HHWIN_PARAM_TABORDER) memcpy(dst->tabOrder, src->tabOrder, sizeof(src->tabOrder));
287  if (merge & HHWIN_PARAM_HISTORY_COUNT) dst->cHistory = src->cHistory;
288  if (merge & HHWIN_PARAM_CUR_TAB) dst->curNavType = src->curNavType;
289 
290  /*
291  * Note: We assume that hwndHelp, hwndCaller, hwndToolBar, hwndNavigation, and hwndHTML cannot be
292  * modified by the user. rcHTML and rcMinSize are not currently supported, so don't bother to copy them.
293  */
294 
295  dst->pszType = MergeChmString(src->pszType, &info->stringsW.pszType);
296  dst->pszFile = MergeChmString(src->pszFile, &info->stringsW.pszFile);
297  dst->pszToc = MergeChmString(src->pszToc, &info->stringsW.pszToc);
298  dst->pszIndex = MergeChmString(src->pszIndex, &info->stringsW.pszIndex);
299  dst->pszCaption = MergeChmString(src->pszCaption, &info->stringsW.pszCaption);
300  dst->pszHome = MergeChmString(src->pszHome, &info->stringsW.pszHome);
301  dst->pszJump1 = MergeChmString(src->pszJump1, &info->stringsW.pszJump1);
302  dst->pszJump2 = MergeChmString(src->pszJump2, &info->stringsW.pszJump2);
303  dst->pszUrlJump1 = MergeChmString(src->pszUrlJump1, &info->stringsW.pszUrlJump1);
304  dst->pszUrlJump2 = MergeChmString(src->pszUrlJump2, &info->stringsW.pszUrlJump2);
305 
306  /* FIXME: pszCustomTabs is a list of multiple zero-terminated strings so ReadString won't
307  * work in this case
308  */
309 #if 0
310  dst->pszCustomTabs = MergeChmString(src->pszCustomTabs, &info->pszCustomTabs);
311 #endif
312 }
#define HHWIN_PARAM_EXPANSION
Definition: htmlhelp.h:93
struct tagHH_WINTYPEW HH_WINTYPEW
static WCHAR * MergeChmString(LPCWSTR src, WCHAR **dst)
Definition: chm.c:249
#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:111
#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 270 of file help.c.

271 {
273 
274  TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
275 
276  if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
277  return FALSE;
278 
279  return SUCCEEDED(navigate_url(info, buf));
280 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:251
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:206
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FALSE
Definition: types.h:117
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.h:32
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: fci.c:126

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

◆ NavigateToUrl()

BOOL NavigateToUrl ( HHInfo ,
LPCWSTR   
)

Definition at line 226 of file help.c.

227 {
228  ChmPath chm_path;
229  BOOL ret;
230  HRESULT hres;
231 
232  static const WCHAR url_indicator[] = {':', '/', '/', 0};
233 
234  TRACE("%s\n", debugstr_w(surl));
235 
236  if (wcsstr(surl, url_indicator)) {
237  hres = navigate_url(info, surl);
238  if(SUCCEEDED(hres))
239  return TRUE;
240  } /* look up in chm if it doesn't look like a full url */
241 
242  SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
243  ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
244 
245  heap_free(chm_path.chm_file);
246  heap_free(chm_path.chm_index);
247 
248  return ret;
249 }
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:206
#define TRUE
Definition: types.h:120
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:270
LPWSTR chm_index
Definition: hhctrl.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.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:79
LPWSTR chm_file
Definition: hhctrl.h:55
int ret
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:503
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 626 of file chm.c.

627 {
628  HRESULT hres;
629  CHMInfo *ret;
630 
631  static const WCHAR wszSTRINGS[] = {'#','S','T','R','I','N','G','S',0};
632 
633  if (!(ret = heap_alloc_zero(sizeof(CHMInfo))))
634  return NULL;
635  ret->codePage = CP_ACP;
636 
637  if (!(ret->szFile = strdupW(szFile))) {
638  heap_free(ret);
639  return NULL;
640  }
641 
642  hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
643  &IID_IITStorage, (void **) &ret->pITStorage) ;
644  if(FAILED(hres)) {
645  WARN("Could not create ITStorage: %08x\n", hres);
646  return CloseCHM(ret);
647  }
648 
649  hres = IITStorage_StgOpenStorage(ret->pITStorage, szFile, NULL,
650  STGM_READ | STGM_SHARE_DENY_WRITE, NULL, 0, &ret->pStorage);
651  if(FAILED(hres)) {
652  WARN("Could not open storage: %08x\n", hres);
653  return CloseCHM(ret);
654  }
655  hres = IStorage_OpenStream(ret->pStorage, wszSTRINGS, NULL, STGM_READ, 0,
656  &ret->strings_stream);
657  if(FAILED(hres)) {
658  WARN("Could not open #STRINGS stream: %08x\n", hres);
659  /* It's not critical, so we pass */
660  }
661 
662  if(!ReadChmSystem(ret)) {
663  WARN("Could not read #SYSTEM\n");
664  return CloseCHM(ret);
665  }
666 
667  return ret;
668 }
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define CP_ACP
Definition: compat.h:109
#define WARN(fmt,...)
Definition: debug.h:112
Definition: hhctrl.h:97
#define STGM_READ
Definition: objbase.h:917
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define NULL
Definition: types.h:112
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:670
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
static BOOL ReadChmSystem(CHMInfo *chm)
Definition: chm.c:82
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 1815 of file help.c.

1816 {
1817  TRACE("(%p)\n", info);
1818 
1819  if (!info)
1820  return;
1821 
1822  list_remove(&info->entry);
1823 
1824  wintype_stringsA_free(&info->stringsA);
1825  wintype_stringsW_free(&info->stringsW);
1826 
1827  if (info->pCHMInfo)
1828  CloseCHM(info->pCHMInfo);
1829 
1832  ReleaseIndex(info);
1834 
1835  if(info->contents.hImageList)
1836  ImageList_Destroy(info->contents.hImageList);
1837  if(info->WinType.hwndHelp)
1838  DestroyWindow(info->WinType.hwndHelp);
1839 
1840  heap_free(info);
1841  OleUninitialize();
1842 }
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1786
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:928
__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:1800
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:670
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
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 }
static unsigned __int64 next
Definition: rand_nt.c:6
static ATOM item
Definition: dde.c:856
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
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 }
static ATOM item
Definition: dde.c:856
#define NULL
Definition: types.h:112
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
if SUCCEEDED(hr)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
#define NULL
Definition: types.h:112

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:63
static const WCHAR dwWidth[]
Definition: provider.c:62

Referenced by Help_OnSize().

◆ SetChmPath()

void SetChmPath ( ChmPath ,
LPCWSTR  ,
LPCWSTR   
)

Definition at line 503 of file chm.c.

504 {
505  LPCWSTR ptr;
506  static const WCHAR separatorW[] = {':',':',0};
507 
508  path = skip_schema(path);
509 
511  if(ptr) {
512  WCHAR chm_file[MAX_PATH];
513  WCHAR rel_path[MAX_PATH];
514  WCHAR base_path[MAX_PATH];
515  LPWSTR p;
516 
517  lstrcpyW(base_path, base_file);
518  p = wcsrchr(base_path, '\\');
519  if(p)
520  *p = 0;
521 
522  memcpy(rel_path, path, (ptr-path)*sizeof(WCHAR));
523  rel_path[ptr-path] = 0;
524 
525  PathCombineW(chm_file, base_path, rel_path);
526 
527  file->chm_file = strdupW(chm_file);
528  ptr += 2;
529  }else {
530  file->chm_file = strdupW(base_file);
531  ptr = path;
532  }
533 
534  file->chm_index = strdupW(ptr);
535 
536  TRACE("ChmFile = {%s %s}\n", debugstr_w(file->chm_file), debugstr_w(file->chm_index));
537 }
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
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
#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:34
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define wcsrchr
Definition: compat.h:16
#define lstrcpyW
Definition: compat.h:749
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:194
LPCWSTR skip_schema(LPCWSTR url)
Definition: chm.c:487
Definition: fci.c:126

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

◆ skip_schema()

LPCWSTR skip_schema ( LPCWSTR  url)

Definition at line 487 of file chm.c.

488 {
489  static const WCHAR its_schema[] = {'i','t','s',':'};
490  static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
491  static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
492 
493  if(!_wcsnicmp(its_schema, url, ARRAY_SIZE(its_schema)))
494  return url + ARRAY_SIZE(its_schema);
495  if(!_wcsnicmp(msits_schema, url, ARRAY_SIZE(msits_schema)))
496  return url + ARRAY_SIZE(msits_schema);
497  if(!_wcsnicmp(mk_schema, url, ARRAY_SIZE(mk_schema)))
498  return url + ARRAY_SIZE(mk_schema);
499 
500  return url;
501 }
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
__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 294 of file hhctrl.h.

295 {
296  return strdupnAtoW(str, -1);
297 }
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:271
const WCHAR * str

◆ strdupnAtoW()

static LPWSTR strdupnAtoW ( LPCSTR  str,
LONG  lenA 
)
inlinestatic

Definition at line 271 of file hhctrl.h.

272 {
273  LPWSTR ret;
274  DWORD len;
275 
276  if(!str)
277  return NULL;
278 
279  if (lenA > 0)
280  {
281  /* find length of string */
282  LPCSTR eos = memchr(str, 0, lenA);
283  if (eos) lenA = eos - str;
284  }
285 
286  len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
287  ret = heap_alloc(len*sizeof(WCHAR));
288  MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
289  ret[len-1] = 0;
290 
291  return ret;
292 }
#define memchr(s, c, n)
Definition: mkisofs.h:875
#define CP_ACP
Definition: compat.h:109
static void size_t len
Definition: hhctrl.h:252
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
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 NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ strdupW()

static LPWSTR strdupW ( LPCWSTR  str)
inlinestatic

Definition at line 256 of file hhctrl.h.

257 {
258  LPWSTR ret;
259  int size;
260 
261  if(!str)
262  return NULL;
263 
264  size = (lstrlenW(str)+1)*sizeof(WCHAR);
265  ret = heap_alloc(size);
266  memcpy(ret, str, size);
267 
268  return ret;
269 }
#define lstrlenW
Definition: compat.h:750
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ strdupWtoA()

static LPSTR strdupWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 299 of file hhctrl.h.

300 {
301  LPSTR ret;
302  DWORD len;
303 
304  if(!str)
305  return NULL;
306 
307  len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
308  ret = heap_alloc(len);
310  return ret;
311 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
static void size_t len
Definition: hhctrl.h:252
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112

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

◆ UpdateHelpWindow()

void UpdateHelpWindow ( HHInfo info)

Definition at line 1576 of file help.c.

1577 {
1578  if (!info->WinType.hwndHelp)
1579  return;
1580 
1581  WARN("Only the size of the window is currently updated.\n");
1582  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1583  {
1584  RECT *rect = &info->WinType.rcWindowPos;
1585  INT x, y, width, height;
1586 
1587  x = rect->left;
1588  y = rect->top;
1589  width = rect->right - x;
1590  height = rect->bottom - y;
1591  SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1593  }
1594 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:112
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1237
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
#define SWP_NOACTIVATE
Definition: winuser.h:1232
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define NULL
Definition: types.h:112
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 1800 of file help.c.

1801 {
1802  heap_free(stringsA->pszType);
1803  heap_free(stringsA->pszCaption);
1804  heap_free(stringsA->pszToc);
1805  heap_free(stringsA->pszIndex);
1806  heap_free(stringsA->pszFile);
1807  heap_free(stringsA->pszHome);
1808  heap_free(stringsA->pszJump1);
1809  heap_free(stringsA->pszJump2);
1810  heap_free(stringsA->pszUrlJump1);
1811  heap_free(stringsA->pszUrlJump2);
1812  heap_free(stringsA->pszCustomTabs);
1813 }
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 1786 of file help.c.

1787 {
1788  heap_free(stringsW->pszType);
1789  heap_free(stringsW->pszCaption);
1790  heap_free(stringsW->pszToc);
1791  heap_free(stringsW->pszIndex);
1792  heap_free(stringsW->pszFile);
1793  heap_free(stringsW->pszHome);
1794  heap_free(stringsW->pszJump1);
1795  heap_free(stringsW->pszJump2);
1796  heap_free(stringsW->pszUrlJump1);
1797  heap_free(stringsW->pszUrlJump2);
1798 }
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 314 of file hhctrl.h.

◆ len

Initial value:
{
#define GetProcessHeap()
Definition: compat.h:736
GLenum GLsizei len
Definition: glext.h:6722
#define HeapReAlloc
Definition: compat.h:734
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
Definition: mem.c:156

Definition at line 252 of file hhctrl.h.

Referenced by strdupnAtoW(), and strdupWtoA().