ReactOS 0.4.16-dev-92-g0c2cdca
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 462 of file comctl32undoc.c.

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

564{
565 DWORD len;
567 INT ret;
568
569 TRACE("(%p,%s)\n", hList, debugstr_a(lpszString));
570
571 if (!hList)
572 return -1;
573
574 if (IsBadStringPtrA(lpszString, -1))
575 {
577 return 0;
578 }
579
580 len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0) * sizeof(WCHAR);
581 stringW = Alloc(len);
582 if (!stringW)
583 return -1;
584
585 MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len/sizeof(WCHAR));
587 Free(stringW);
588 return ret;
589}
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:989
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 541 of file comctl32undoc.c.

542{
543 TRACE("(%p,%s)\n", hList, debugstr_w(lpszString));
544
545 if (!hList)
546 return -1;
547
548 if (!lpszString || IsBadStringPtrW(lpszString, -1))
549 {
551 return 0;
552 }
553
554 return AddMRUData(hList, lpszString,
555 (lstrlenW(lpszString) + 1) * sizeof(WCHAR));
556}
#define lstrlenW
Definition: compat.h:750
BOOL NTAPI IsBadStringPtrW(IN LPCWSTR lpsz, IN UINT_PTR ucchMax)
Definition: except.c:950
#define debugstr_w
Definition: kernel32.h:32

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 768 of file comctl32undoc.c.

770{
771 LPWINEMRULIST mp;
772 DWORD len;
773
774 /* Native does not check for a NULL lpcml */
775
776 if (!lpcml->hKey || IsBadStringPtrA(lpcml->lpszSubKey, -1))
777 return 0;
778
779 mp = Alloc(sizeof(WINEMRULIST));
780 memcpy(&mp->extview, lpcml, sizeof(MRUINFOA));
781 len = MultiByteToWideChar(CP_ACP, 0, lpcml->lpszSubKey, -1, NULL, 0);
782 mp->extview.lpszSubKey = Alloc(len * sizeof(WCHAR));
784 mp->extview.lpszSubKey, len);
785 mp->isUnicode = FALSE;
786 return create_mru_list(mp);
787}
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 736 of file comctl32undoc.c.

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

Referenced by CreateMRUListW(), and init_functions().

◆ CreateMRUListW()

HANDLE WINAPI CreateMRUListW ( LPMRUINFOW  )

◆ DelMRUString()

BOOL WINAPI DelMRUString ( HANDLE  hList,
INT  nItemPos 
)

Definition at line 603 of file comctl32undoc.c.

604{
605 FIXME("(%p, %d): stub\n", hList, nItemPos);
606 return TRUE;
607}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ EnumMRUListA()

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

Definition at line 860 of file comctl32undoc.c.

862{
863 const WINEMRULIST *mp = hList;
864 LPWINEMRUITEM witem;
866 DWORD lenA;
867
868 if (!mp) return -1;
869 if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
870 if (nItemPos >= mp->cursize) return -1;
871 desired = mp->realMRU[nItemPos];
872 desired -= 'a';
873 TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
874 witem = mp->array[desired];
875 if(mp->extview.fFlags & MRU_BINARY) {
876 datasize = min( witem->size, nBufferSize );
877 memcpy( lpBuffer, &witem->datastart, datasize);
878 } else {
879 lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
880 NULL, 0, NULL, NULL);
881 datasize = min( lenA, nBufferSize );
884 ((char *)lpBuffer)[ datasize - 1 ] = '\0';
885 datasize = lenA - 1;
886 }
887 TRACE("(%p, %d, %p, %d): returning len=%d\n",
888 hList, nItemPos, lpBuffer, nBufferSize, datasize);
889 return datasize;
890}
#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 834 of file comctl32undoc.c.

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

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

◆ FindMRUData()

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

Definition at line 388 of file comctl32undoc.c.

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

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

◆ FindMRUStringW()

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

Definition at line 614 of file comctl32undoc.c.

615{
616 return FindMRUData(hList, lpszString,
617 (lstrlenW(lpszString) + 1) * sizeof(WCHAR), lpRegNum);
618}

◆ FreeMRUList()

VOID WINAPI FreeMRUList ( HANDLE  hMRUList)

Definition at line 348 of file comctl32undoc.c.

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

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