ReactOS 0.4.15-dev-6047-gb29e82d
comctl32_undoc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MRUINFOA
 
struct  _MRUINFOW
 

Macros

#define MRUINFO   MRUINFOA
 
#define LPMRUINFO   LPMRUINFOA
 
#define MRU_STRING   0x0
 
#define MRU_BINARY   0x1
 
#define MRU_CACHEWRITE   0x2
 
#define CreateMRUList   CreateMRUListA
 
#define CreateMRUListLazy   CreateMRUListLazyA
 
#define AddMRUString   AddMRUStringA
 
#define EnumMRUList   EnumMRUListA
 
#define FindMRUString   FindMRUStringA
 
#define I_CreateMRUListA   151
 
#define I_CreateMRUListW   400
 
#define I_CreateMRUListLazyA   157
 
#define I_CreateMRUListLazyW   404
 
#define I_AddMRUStringA   153
 
#define I_AddMRUStringW   401
 
#define I_AddMRUData   167
 
#define I_EnumMRUListA   154
 
#define I_EnumMRUListW   403
 
#define I_FindMRUData   169
 
#define I_FindMRUStringA   155
 
#define I_FindMRUStringW   402
 
#define I_DelMRUString   156
 
#define I_FreeMRUList   152
 

Typedefs

typedef INT(CALLBACKMRUCMPPROCA) (LPCSTR, LPCSTR)
 
typedef INT(CALLBACKMRUCMPPROCW) (LPCWSTR, LPCWSTR)
 
typedef INT(CALLBACKMRUBINARYCMPPROC) (LPCVOID, LPCVOID, DWORD)
 
typedef struct _MRUINFOA MRUINFOA
 
typedef struct _MRUINFOALPMRUINFOA
 
typedef struct _MRUINFOW MRUINFOW
 
typedef struct _MRUINFOWLPMRUINFOW
 
typedef HANDLE(WINAPIFN_CreateMRUListA) (const MRUINFOA *)
 
typedef HANDLE(WINAPIFN_CreateMRUListW) (const MRUINFOW *)
 
typedef HANDLE(WINAPIFN_CreateMRUListLazyA) (const MRUINFOA *, DWORD, DWORD, DWORD)
 
typedef HANDLE(WINAPIFN_CreateMRUListLazyW) (const MRUINFOW *, DWORD, DWORD, DWORD)
 
typedef INT(WINAPIFN_AddMRUStringA) (HANDLE, LPCSTR)
 
typedef INT(WINAPIFN_AddMRUStringW) (HANDLE, LPCWSTR)
 
typedef INT(WINAPIFN_AddMRUData) (HANDLE, LPCVOID, DWORD)
 
typedef INT(WINAPIFN_EnumMRUListA) (HANDLE, INT, LPVOID, DWORD)
 
typedef INT(WINAPIFN_EnumMRUListW) (HANDLE, INT, LPVOID, DWORD)
 
typedef INT(WINAPIFN_FindMRUData) (HANDLE, LPCVOID, DWORD, LPINT)
 
typedef INT(WINAPIFN_FindMRUStringA) (HANDLE, LPCSTR, LPINT)
 
typedef INT(WINAPIFN_FindMRUStringW) (HANDLE, LPCWSTR, LPINT)
 
typedef BOOL(WINAPIFN_DelMRUString) (HANDLE, INT)
 
typedef INT(WINAPIFN_FreeMRUList) (HANDLE)
 

Functions

HANDLE WINAPI CreateMRUListA (LPMRUINFOA)
 
HANDLE WINAPI CreateMRUListW (LPMRUINFOW)
 
HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
 
HANDLE WINAPI CreateMRUListLazyA (const MRUINFOA *lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
 
INT WINAPI AddMRUData (HANDLE, LPCVOID, DWORD)
 
INT WINAPI AddMRUStringA (HANDLE hList, LPCSTR lpszString)
 
INT WINAPI AddMRUStringW (HANDLE hList, LPCWSTR lpszString)
 
INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
 
INT WINAPI EnumMRUListW (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
 
INT WINAPI FindMRUData (HANDLE, LPCVOID, DWORD, LPINT)
 
INT WINAPI FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum)
 
INT WINAPI FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
 
BOOL WINAPI DelMRUString (HANDLE hList, INT nItemPos)
 
VOID WINAPI FreeMRUList (HANDLE)
 

Macro Definition Documentation

◆ AddMRUString

#define AddMRUString   AddMRUStringA

Definition at line 104 of file comctl32_undoc.h.

◆ CreateMRUList

#define CreateMRUList   CreateMRUListA

Definition at line 102 of file comctl32_undoc.h.

◆ CreateMRUListLazy

#define CreateMRUListLazy   CreateMRUListLazyA

Definition at line 103 of file comctl32_undoc.h.

◆ EnumMRUList

#define EnumMRUList   EnumMRUListA

Definition at line 105 of file comctl32_undoc.h.

◆ FindMRUString

#define FindMRUString   FindMRUStringA

Definition at line 106 of file comctl32_undoc.h.

◆ I_AddMRUData

#define I_AddMRUData   167

Definition at line 132 of file comctl32_undoc.h.

◆ I_AddMRUStringA

#define I_AddMRUStringA   153

Definition at line 130 of file comctl32_undoc.h.

◆ I_AddMRUStringW

#define I_AddMRUStringW   401

Definition at line 131 of file comctl32_undoc.h.

◆ I_CreateMRUListA

#define I_CreateMRUListA   151

Definition at line 126 of file comctl32_undoc.h.

◆ I_CreateMRUListLazyA

#define I_CreateMRUListLazyA   157

Definition at line 128 of file comctl32_undoc.h.

◆ I_CreateMRUListLazyW

#define I_CreateMRUListLazyW   404

Definition at line 129 of file comctl32_undoc.h.

◆ I_CreateMRUListW

#define I_CreateMRUListW   400

Definition at line 127 of file comctl32_undoc.h.

◆ I_DelMRUString

#define I_DelMRUString   156

Definition at line 138 of file comctl32_undoc.h.

◆ I_EnumMRUListA

#define I_EnumMRUListA   154

Definition at line 133 of file comctl32_undoc.h.

◆ I_EnumMRUListW

#define I_EnumMRUListW   403

Definition at line 134 of file comctl32_undoc.h.

◆ I_FindMRUData

#define I_FindMRUData   169

Definition at line 135 of file comctl32_undoc.h.

◆ I_FindMRUStringA

#define I_FindMRUStringA   155

Definition at line 136 of file comctl32_undoc.h.

◆ I_FindMRUStringW

#define I_FindMRUStringW   402

Definition at line 137 of file comctl32_undoc.h.

◆ I_FreeMRUList

#define I_FreeMRUList   152

Definition at line 139 of file comctl32_undoc.h.

◆ LPMRUINFO

#define LPMRUINFO   LPMRUINFOA

Definition at line 66 of file comctl32_undoc.h.

◆ MRU_BINARY

#define MRU_BINARY   0x1

Definition at line 71 of file comctl32_undoc.h.

◆ MRU_CACHEWRITE

#define MRU_CACHEWRITE   0x2

Definition at line 72 of file comctl32_undoc.h.

◆ MRU_STRING

#define MRU_STRING   0x0

Definition at line 70 of file comctl32_undoc.h.

◆ MRUINFO

#define MRUINFO   MRUINFOA

Definition at line 65 of file comctl32_undoc.h.

Typedef Documentation

◆ FN_AddMRUData

typedef INT(WINAPI * FN_AddMRUData) (HANDLE, LPCVOID, DWORD)

Definition at line 117 of file comctl32_undoc.h.

◆ FN_AddMRUStringA

typedef INT(WINAPI * FN_AddMRUStringA) (HANDLE, LPCSTR)

Definition at line 115 of file comctl32_undoc.h.

◆ FN_AddMRUStringW

typedef INT(WINAPI * FN_AddMRUStringW) (HANDLE, LPCWSTR)

Definition at line 116 of file comctl32_undoc.h.

◆ FN_CreateMRUListA

typedef HANDLE(WINAPI * FN_CreateMRUListA) (const MRUINFOA *)

Definition at line 111 of file comctl32_undoc.h.

◆ FN_CreateMRUListLazyA

typedef HANDLE(WINAPI * FN_CreateMRUListLazyA) (const MRUINFOA *, DWORD, DWORD, DWORD)

Definition at line 113 of file comctl32_undoc.h.

◆ FN_CreateMRUListLazyW

typedef HANDLE(WINAPI * FN_CreateMRUListLazyW) (const MRUINFOW *, DWORD, DWORD, DWORD)

Definition at line 114 of file comctl32_undoc.h.

◆ FN_CreateMRUListW

typedef HANDLE(WINAPI * FN_CreateMRUListW) (const MRUINFOW *)

Definition at line 112 of file comctl32_undoc.h.

◆ FN_DelMRUString

typedef BOOL(WINAPI * FN_DelMRUString) (HANDLE, INT)

Definition at line 123 of file comctl32_undoc.h.

◆ FN_EnumMRUListA

typedef INT(WINAPI * FN_EnumMRUListA) (HANDLE, INT, LPVOID, DWORD)

Definition at line 118 of file comctl32_undoc.h.

◆ FN_EnumMRUListW

typedef INT(WINAPI * FN_EnumMRUListW) (HANDLE, INT, LPVOID, DWORD)

Definition at line 119 of file comctl32_undoc.h.

◆ FN_FindMRUData

typedef INT(WINAPI * FN_FindMRUData) (HANDLE, LPCVOID, DWORD, LPINT)

Definition at line 120 of file comctl32_undoc.h.

◆ FN_FindMRUStringA

typedef INT(WINAPI * FN_FindMRUStringA) (HANDLE, LPCSTR, LPINT)

Definition at line 121 of file comctl32_undoc.h.

◆ FN_FindMRUStringW

typedef INT(WINAPI * FN_FindMRUStringW) (HANDLE, LPCWSTR, LPINT)

Definition at line 122 of file comctl32_undoc.h.

◆ FN_FreeMRUList

typedef INT(WINAPI * FN_FreeMRUList) (HANDLE)

Definition at line 124 of file comctl32_undoc.h.

◆ LPMRUINFOA

◆ LPMRUINFOW

◆ MRUBINARYCMPPROC

typedef INT(CALLBACK * MRUBINARYCMPPROC) (LPCVOID, LPCVOID, DWORD)

Definition at line 40 of file comctl32_undoc.h.

◆ MRUCMPPROCA

typedef INT(CALLBACK * MRUCMPPROCA) (LPCSTR, LPCSTR)

Definition at line 36 of file comctl32_undoc.h.

◆ MRUCMPPROCW

typedef INT(CALLBACK * MRUCMPPROCW) (LPCWSTR, LPCWSTR)

Definition at line 38 of file comctl32_undoc.h.

◆ MRUINFOA

◆ MRUINFOW

Function Documentation

◆ AddMRUData()

INT WINAPI AddMRUData ( HANDLE  hList,
LPCVOID  lpData,
DWORD  cbData 
)

Definition at line 465 of file comctl32undoc.c.

466{
467 LPWINEMRULIST mp = hList;
468 LPWINEMRUITEM witem;
469 INT i, replace;
470
471 if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) {
472 /* Item exists, just move it to the front */
473 LPWSTR pos = strchrW(mp->realMRU, replace + 'a');
474 while (pos > mp->realMRU)
475 {
476 pos[0] = pos[-1];
477 pos--;
478 }
479 }
480 else {
481 /* either add a new entry or replace oldest */
482 if (mp->cursize < mp->extview.uMax) {
483 /* Add in a new item */
484 replace = mp->cursize;
485 mp->cursize++;
486 }
487 else {
488 /* get the oldest entry and replace data */
489 replace = mp->realMRU[mp->cursize - 1] - 'a';
490 Free(mp->array[replace]);
491 }
492
493 /* Allocate space for new item and move in the data */
494 mp->array[replace] = witem = Alloc(cbData + sizeof(WINEMRUITEM));
495 witem->itemFlag |= WMRUIF_CHANGED;
496 witem->size = cbData;
497 memcpy( &witem->datastart, lpData, cbData);
498
499 /* now rotate MRU list */
500 for(i=mp->cursize-1; i>=1; i--)
501 mp->realMRU[i] = mp->realMRU[i-1];
502 }
503
504 /* The new item gets the front spot */
506 mp->realMRU[0] = replace + 'a';
507
508 TRACE("(%p, %p, %d) adding data, /%c/ now most current\n",
509 hList, lpData, cbData, replace+'a');
510
511 if (!(mp->extview.fFlags & MRU_CACHEWRITE)) {
512 /* save changed stuff right now */
513 MRU_SaveChanged( mp );
514 }
515
516 return replace;
517}
#define WMRUIF_CHANGED
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
LPVOID WINAPI Alloc(DWORD dwSize)
Definition: comctl32undoc.c:71
static void MRU_SaveChanged(LPWINEMRULIST mp)
#define WMRUF_CHANGED
#define MRU_CACHEWRITE
#define NULL
Definition: types.h:112
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
HWND hList
Definition: livecd.c:10
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define strchrW(s, c)
Definition: unicode.h:34
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
#define TRACE(s)
Definition: solgame.cpp:4
LPWINEMRUITEM * array
MRUINFOW extview
int32_t INT
Definition: typedefs.h:58
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by AddMRUStringA(), AddMRUStringW(), and init_functions().

◆ AddMRUStringA()

INT WINAPI AddMRUStringA ( HANDLE  hList,
LPCSTR  lpszString 
)

Definition at line 566 of file comctl32undoc.c.

567{
568 DWORD len;
570 INT ret;
571
572 TRACE("(%p,%s)\n", hList, debugstr_a(lpszString));
573
574 if (!hList)
575 return -1;
576
577 if (IsBadStringPtrA(lpszString, -1))
578 {
580 return 0;
581 }
582
583 len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0) * sizeof(WCHAR);
584 stringW = Alloc(len);
585 if (!stringW)
586 return -1;
587
588 MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len/sizeof(WCHAR));
590 Free(stringW);
591 return ret;
592}
INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData)
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define MultiByteToWideChar
Definition: compat.h:110
BOOL NTAPI IsBadStringPtrA(IN LPCSTR lpsz, IN UINT_PTR ucchMax)
Definition: except.c:987
static const WCHAR stringW[]
Definition: engine.c:38
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_a
Definition: kernel32.h:31
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by init_functions().

◆ AddMRUStringW()

INT WINAPI AddMRUStringW ( HANDLE  hList,
LPCWSTR  lpszString 
)

Definition at line 544 of file comctl32undoc.c.

545{
546 TRACE("(%p,%s)\n", hList, debugstr_w(lpszString));
547
548 if (!hList)
549 return -1;
550
551 if (!lpszString || IsBadStringPtrW(lpszString, -1))
552 {
554 return 0;
555 }
556
557 return AddMRUData(hList, lpszString,
558 (strlenW(lpszString) + 1) * sizeof(WCHAR));
559}
BOOL NTAPI IsBadStringPtrW(IN LPCWSTR lpsz, IN UINT_PTR ucchMax)
Definition: except.c:948
#define debugstr_w
Definition: kernel32.h:32
#define strlenW(s)
Definition: unicode.h:28

Referenced by COpenWithList::AddAppToMRUList().

◆ CreateMRUListA()

HANDLE WINAPI CreateMRUListA ( LPMRUINFOA  )

◆ CreateMRUListLazyA()

HANDLE WINAPI CreateMRUListLazyA ( const MRUINFOA lpcml,
DWORD  dwParam2,
DWORD  dwParam3,
DWORD  dwParam4 
)

Definition at line 771 of file comctl32undoc.c.

773{
774 LPWINEMRULIST mp;
775 DWORD len;
776
777 /* Native does not check for a NULL lpcml */
778
779 if (!lpcml->hKey || IsBadStringPtrA(lpcml->lpszSubKey, -1))
780 return 0;
781
782 mp = Alloc(sizeof(WINEMRULIST));
783 memcpy(&mp->extview, lpcml, sizeof(MRUINFOA));
784 len = MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1, NULL, 0);
785 mp->extview.lpszSubKey = Alloc(len * sizeof(WCHAR));
787 mp->extview.lpszSubKey, len);
788 mp->isUnicode = FALSE;
789 return create_mru_list(mp);
790}
static HANDLE create_mru_list(LPWINEMRULIST mp)
#define FALSE
Definition: types.h:117
LPSTR lpszSubKey
LPWSTR lpszSubKey

Referenced by CreateMRUListA(), and init_functions().

◆ CreateMRUListLazyW()

HANDLE WINAPI CreateMRUListLazyW ( const MRUINFOW lpcml,
DWORD  dwParam2,
DWORD  dwParam3,
DWORD  dwParam4 
)

Definition at line 739 of file comctl32undoc.c.

741{
742 LPWINEMRULIST mp;
743
744 /* Native does not check for a NULL lpcml */
745 if (!infoW->hKey || IsBadStringPtrW(infoW->lpszSubKey, -1))
746 return NULL;
747
748 mp = Alloc(sizeof(WINEMRULIST));
749 memcpy(&mp->extview, infoW, sizeof(MRUINFOW));
750 mp->extview.lpszSubKey = Alloc((strlenW(infoW->lpszSubKey) + 1) * sizeof(WCHAR));
751 strcpyW(mp->extview.lpszSubKey, infoW->lpszSubKey);
752 mp->isUnicode = TRUE;
753
754 return create_mru_list(mp);
755}
#define TRUE
Definition: types.h:120
static const SecPkgInfoW infoW
Definition: kerberos.c:293
#define strcpyW(d, s)
Definition: unicode.h:29

Referenced by CreateMRUListW(), and init_functions().

◆ CreateMRUListW()

HANDLE WINAPI CreateMRUListW ( LPMRUINFOW  )

◆ DelMRUString()

BOOL WINAPI DelMRUString ( HANDLE  hList,
INT  nItemPos 
)

Definition at line 606 of file comctl32undoc.c.

607{
608 FIXME("(%p, %d): stub\n", hList, nItemPos);
609 return TRUE;
610}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ EnumMRUListA()

INT WINAPI EnumMRUListA ( HANDLE  hList,
INT  nItemPos,
LPVOID  lpBuffer,
DWORD  nBufferSize 
)

Definition at line 863 of file comctl32undoc.c.

865{
866 const WINEMRULIST *mp = hList;
867 LPWINEMRUITEM witem;
869 DWORD lenA;
870
871 if (!mp) return -1;
872 if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
873 if (nItemPos >= mp->cursize) return -1;
874 desired = mp->realMRU[nItemPos];
875 desired -= 'a';
876 TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
877 witem = mp->array[desired];
878 if(mp->extview.fFlags & MRU_BINARY) {
879 datasize = min( witem->size, nBufferSize );
880 memcpy( lpBuffer, &witem->datastart, datasize);
881 } else {
882 lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
883 NULL, 0, NULL, NULL);
884 datasize = min( lenA, nBufferSize );
887 ((char *)lpBuffer)[ datasize - 1 ] = '\0';
888 datasize = lenA - 1;
889 }
890 TRACE("(%p, %d, %p, %d): returning len=%d\n",
891 hList, nItemPos, lpBuffer, nBufferSize, datasize);
892 return datasize;
893}
#define MRU_BINARY
static SIZE_T datasize
Definition: asm.c:30
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define WideCharToMultiByte
Definition: compat.h:111
int desired
Definition: jpeglib.h:1119
#define min(a, b)
Definition: monoChain.cc:55

Referenced by init_functions().

◆ EnumMRUListW()

INT WINAPI EnumMRUListW ( HANDLE  hList,
INT  nItemPos,
LPVOID  lpBuffer,
DWORD  nBufferSize 
)

Definition at line 837 of file comctl32undoc.c.

839{
840 const WINEMRULIST *mp = hList;
841 const WINEMRUITEM *witem;
843
844 if (!mp) return -1;
845 if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
846 if (nItemPos >= mp->cursize) return -1;
847 desired = mp->realMRU[nItemPos];
848 desired -= 'a';
849 TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
850 witem = mp->array[desired];
851 datasize = min( witem->size, nBufferSize );
852 memcpy( lpBuffer, &witem->datastart, datasize);
853 TRACE("(%p, %d, %p, %d): returning len=%d\n",
854 hList, nItemPos, lpBuffer, nBufferSize, datasize);
855 return datasize;
856}

Referenced by init_functions(), and COpenWithList::LoadMRUList().

◆ FindMRUData()

INT WINAPI FindMRUData ( HANDLE  hList,
LPCVOID  lpData,
DWORD  cbData,
LPINT  lpRegNum 
)

Definition at line 391 of file comctl32undoc.c.

393{
394 const WINEMRULIST *mp = hList;
395 INT ret;
396 UINT i;
397 LPSTR dataA = NULL;
398
399 if (!mp || !mp->extview.u.string_cmpfn)
400 return -1;
401
402 if(!(mp->extview.fFlags & MRU_BINARY) && !mp->isUnicode) {
403 DWORD len = WideCharToMultiByte(CP_ACP, 0, lpData, -1,
404 NULL, 0, NULL, NULL);
405 dataA = Alloc(len);
406 WideCharToMultiByte(CP_ACP, 0, lpData, -1, dataA, len, NULL, NULL);
407 }
408
409 for(i=0; i<mp->cursize; i++) {
410 if (mp->extview.fFlags & MRU_BINARY) {
411 if (!mp->extview.u.binary_cmpfn(lpData, &mp->array[i]->datastart, cbData))
412 break;
413 }
414 else {
415 if(mp->isUnicode) {
416 if (!mp->extview.u.string_cmpfn(lpData, (LPWSTR)&mp->array[i]->datastart))
417 break;
418 } else {
420 (LPWSTR)&mp->array[i]->datastart, -1,
421 NULL, 0, NULL, NULL);
422 LPSTR itemA = Alloc(len);
423 INT cmp;
425 itemA, len, NULL, NULL);
426
427 cmp = mp->extview.u.string_cmpfn((LPWSTR)dataA, (LPWSTR)itemA);
428 Free(itemA);
429 if(!cmp)
430 break;
431 }
432 }
433 }
434 Free(dataA);
435 if (i < mp->cursize)
436 ret = i;
437 else
438 ret = -1;
439 if (lpRegNum && (ret != -1))
440 *lpRegNum = 'a' + i;
441
442 TRACE("(%p, %p, %d, %p) returning %d\n",
443 hList, lpData, cbData, lpRegNum, ret);
444
445 return ret;
446}
#define cmp(status, error)
Definition: error.c:114
unsigned int UINT
Definition: ndis.h:50
union tagMRUINFOW::@327 u
MRUBinaryCmpFn binary_cmpfn
MRUStringCmpFnW string_cmpfn
char * LPSTR
Definition: xmlstorage.h:182

Referenced by AddMRUData(), FindMRUStringA(), FindMRUStringW(), and init_functions().

◆ FindMRUStringA()

INT WINAPI FindMRUStringA ( HANDLE  hList,
LPCSTR  lpszString,
LPINT  lpRegNum 
)

Definition at line 638 of file comctl32undoc.c.

639{
640 DWORD len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0);
641 LPWSTR stringW = Alloc(len * sizeof(WCHAR));
642 INT ret;
643
644 MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len);
645 ret = FindMRUData(hList, stringW, len * sizeof(WCHAR), lpRegNum);
646 Free(stringW);
647 return ret;
648}

◆ FindMRUStringW()

INT WINAPI FindMRUStringW ( HANDLE  hList,
LPCWSTR  lpszString,
LPINT  lpRegNum 
)

Definition at line 617 of file comctl32undoc.c.

618{
619 return FindMRUData(hList, lpszString,
620 (lstrlenW(lpszString) + 1) * sizeof(WCHAR), lpRegNum);
621}
#define lstrlenW
Definition: compat.h:750

◆ FreeMRUList()

VOID WINAPI FreeMRUList ( HANDLE  hMRUList)

Definition at line 351 of file comctl32undoc.c.

352{
353 LPWINEMRULIST mp = hMRUList;
354 UINT i;
355
356 TRACE("(%p)\n", hMRUList);
357 if (!hMRUList)
358 return;
359
360 if (mp->wineFlags & WMRUF_CHANGED) {
361 /* need to open key and then save the info */
362 MRU_SaveChanged( mp );
363 }
364
365 for(i=0; i<mp->extview.uMax; i++)
366 Free(mp->array[i]);
367
368 Free(mp->realMRU);
369 Free(mp->array);
371 Free(mp);
372}

Referenced by COpenWithList::AddAppToMRUList(), init_functions(), and COpenWithList::LoadMRUList().