* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
+#include "config.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
-#include <config.h>
-#include <wine/debug.h>
-#include <wine/unicode.h>
+#include <stdarg.h>
-//#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include "icm.h"
-//#include "windef.h"
-//#include "winbase.h"
-//#include "winnls.h"
-#include <wingdi.h>
-#include <winuser.h>
-#include <winreg.h>
-//#include "shlwapi.h"
-#include <icm.h>
-
-//#include "mscms_priv.h"
+#include "mscms_priv.h"
static void basename( LPCWSTR path, LPWSTR name )
{
if (machine || !size) return FALSE;
- GetSystemDirectoryW( colordir, sizeof(colordir) / sizeof(WCHAR) );
+ GetSystemDirectoryW( colordir, ARRAY_SIZE( colordir ));
lstrcatW( colordir, colorsubdir );
len = lstrlenW( colordir ) * sizeof(WCHAR);
lstrcatW( rgbprofile, rgbprofilefile );
len = lstrlenW( rgbprofile ) * sizeof(WCHAR);
- if (*size < len || !profile)
+ if (*size < len)
{
*size = len;
SetLastError( ERROR_MORE_DATA );
static BOOL header_from_file( LPCWSTR file, PPROFILEHEADER header )
{
+ static const WCHAR slash[] = {'\\',0};
BOOL ret;
PROFILE profile;
- WCHAR path[MAX_PATH], slash[] = {'\\',0};
+ WCHAR path[MAX_PATH];
DWORD size = sizeof(path);
HANDLE handle;
BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer,
PDWORD size, PDWORD number )
{
+ static const WCHAR spec[] = {'\\','*','i','c','m',0};
BOOL match, ret = FALSE;
- WCHAR spec[] = {'\\','*','i','c','m',0};
WCHAR colordir[MAX_PATH], glob[MAX_PATH], **profiles = NULL;
DWORD i, len = sizeof(colordir), count = 0, totalsize = 0;
PROFILEHEADER header;
release_profile( profile );
return FALSE;
}
- *present = cmsIsTag( profile->cmsprofile, type );
+ *present = (cmsIsTag( profile->cmsprofile, type ) != 0);
release_profile( profile );
ret = TRUE;
if (!(data = HeapAlloc( GetProcessHeap(), 0, profile->cbDataSize ))) return NULL;
memcpy( data, profile->pProfileData, profile->cbDataSize );
- cmsprofile = cmsOpenProfileFromMem( data, profile->cbDataSize );
+ if (!(cmsprofile = cmsOpenProfileFromMem( data, profile->cbDataSize )))
+ {
+ HeapFree( GetProcessHeap(), 0, data );
+ return FALSE;
+ }
size = profile->cbDataSize;
}
else if (profile->dwType == PROFILE_FILENAME)
HeapFree( GetProcessHeap(), 0, data );
return NULL;
}
- cmsprofile = cmsOpenProfileFromMem( data, size );
+ if (!(cmsprofile = cmsOpenProfileFromMem( data, size )))
+ {
+ CloseHandle( handle );
+ HeapFree( GetProcessHeap(), 0, data );
+ return NULL;
+ }
}
else
{
#endif /* HAVE_LCMS2 */
return ret;
}
+
+/******************************************************************************
+ * WcsGetUsePerUserProfiles [MSCMS.@]
+ */
+BOOL WINAPI WcsGetUsePerUserProfiles( const WCHAR* name, DWORD class, BOOL* use_per_user_profile )
+{
+ FIXME( "%s %s %p\n", debugstr_w(name), dbgstr_tag(class), use_per_user_profile );
+ SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
+ return FALSE;
+}
+
+/******************************************************************************
+ * WcsEnumColorProfilesSize [MSCMS.@]
+ */
+BOOL WINAPI WcsEnumColorProfilesSize( WCS_PROFILE_MANAGEMENT_SCOPE scope, ENUMTYPEW *record, DWORD *size )
+{
+ FIXME( "%d %p %p\n", scope, record, size );
+ SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
+ return FALSE;
+}