Download Pelles C here: http://www.smorgasbordet.com/pellesc/
WallPaper.asm(12): fatal error: Invalid use of '{'.
sCLSID_IActiveDesktop TEXTEQU <{075048700h,0EF1Fh,011D0h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>
sIID_IActiveDesktop TEXTEQU <{0F490EB00h,01240h,011D1h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>
GUID STRUCT
Data1 dd ?
Data2 dw ?
Data3 dw ?
Data4 db 8 dup(?)
GUID ENDS
.data
CLSID_IActiveDesktop GUID sCLSID_IActiveDesktop
IID_IActiveDesktop GUID sIID_IActiveDesktop
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
int __cdecl main(void)
{
HANDLE hDir;
DWORD dwRC;
PFILE_NOTIFY_INFORMATION pfni;
WCHAR fni[(sizeof(FILE_NOTIFY_INFORMATION)+1024)*1];
hDir = CreateFile(".\\", FILE_LIST_DIRECTORY,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hDir != INVALID_HANDLE_VALUE) {
printf("start watch\n");
if (ReadDirectoryChangesW(hDir, &fni, sizeof(fni), FALSE,
FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE,
&dwRC, NULL, NULL))
{
pfni = (PFILE_NOTIFY_INFORMATION)&fni;
printf("%p [%ls]\n", (void*)pfni->NextEntryOffset, pfni->FileName);
//printf("%p [%*ls]\n", (void*)pfni->NextEntryOffset, pfni->FileNameLength, pfni->FileName);
}
CloseHandle(hDir);
}
return 0;
}
Quote from: John Z on Yesterday at 04:11:48 PMHave I missed checking an option or is this intentional behavior, or heaven forbid a bug?Looks like a bug, but I can't find any significant changes in this area since early 2020...
Quote from: Pelle on Yesterday at 03:59:49 PMThis could be worked around by replacing the macro with an inline function
Quote from: Pelle on Yesterday at 03:59:49 PMI prefer to keep the Windows SDK as original as possible.
#define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
(BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
((prc) ? ((((LPRECT)(prc))->top = (iSubItem)), (((LPRECT)(prc))->left = (code)), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
((prc) ? ... : ..)
is in your case ((&rc) ? ... : ...) /* i.e. ((&rc != NULL) ? ... : ...) */
which will always be true.entry_point PROC PARMAREA=5*QWORD
entry_point PROC PARMAREA=5* SIZEOF QWORD
warning #2130: Result of comparison is constant.
#pragma comment(lib, "user32.lib") // <-- Added
#pragma comment(lib, "comctl32.lib") // <-- Added
...
BOOL InitListView(HWND hwndListView)
{
...
RECT rc; // <-- Added
ListView_GetSubItemRect(hwndListView, 0, 1, LVIR_LABEL, &rc); // <-- Added - generate the warning message
}
set PCPATH=c:\PellesC
Page created in 0.047 seconds with 15 queries.