NO

Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
Bug reports / Compiling using AVX2
« Last post by HellOfMice on November 05, 2024, 04:57:37 PM »
When compiling using AVX2, I had this message:
***************************************************
Building BrowseForFolder.obj.
Building Gray.obj.
Building Log.obj.
Building MemorySetTo0.obj.
Building Profile.obj.
Building Search.obj.
C:\Users\51966\Documents\# IA 2024\Search\Speed Test\Search.c(451): warning #2804: Consider changing type to 'size_t' for loop variable '_i'.
C:\Users\51966\Documents\# IA 2024\Search\Speed Test\Search.c(451): warning #2804: Consider changing type to 'size_t' for loop variable '_i'.
fatal error: Internal error: get_rule_number().
*** Error code: 1 ***
Done.
********************************************************
For CPU-Z I have the following CPU
Code: [Select]
CPU-Z TXT Report
-------------------------------------------------------------------------
CPU-Z version         2.11.2.x64

Processors
-------------------------------------------------------------------------
CPU Groups         1
CPU Group 0         16 threads, mask=0xFFFF

Number of sockets      1
Number of threads      16

Timers
-------------------------------------------------------------------------
   ACPI timer      3.580 MHz
   Perf timer      10.000 MHz
   Sys timer      1.000 KHz

Processors Information
-------------------------------------------------------------------------
Socket 1         ID = 0
   Number of cores      8 (max
   Number of threads   16 (max 16)
   Number of CCDs      1
   Manufacturer      AuthenticAMD
   Name         AMD Ryzen 7 Mobile 5700U
   Codename      Lucienne
   Specification      AMD Ryzen 7 5700U with Radeon Graphics         
   Package       Socket FP6
   CPUID         F.8.1
   Extended CPUID      17.68
   Core Stepping     
   Technology      7 nm
   Core Speed      1926.9 MHz
   Multiplier x Bus Speed   19.33 x 99.7 MHz
   Base frequency (cores)   99.7 MHz
   Instructions sets   MMX (+), SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A, x86-64, AES, AVX, AVX2, FMA3, SHA
   Microcode Revision   0x8608107
   L1 Data cache      8 x 32 KB (8-way, 64-byte line)
   L1 Instruction cache   8 x 32 KB (8-way, 64-byte line)
   L2 cache      8 x 512 KB (8-way, 64-byte line)
   L3 cache      2 x 4 MB (16-way, 64-byte line)
   Max CPUID level      0000000Dh
   Max CPUID ext. level   80000020h
   FID/VID Control      yes
   # of P-States      3
   P-State         FID 0xA5A - VID 0x35 (18.00x - 1.219 V)
   P-State         FID 0xC66 - VID 0x60 (17.00x - 0.950 V)
   P-State         FID 0xE62 - VID 0x66 (14.00x - 0.912 V)

Software
-------------------------------------------------------------------------
Windows Version         Microsoft Windows 11  Home (x64), Version 23H2, Build 22631.4391
Windows Installation Date   10/26/2024
DirectX Version         12.0

Register Spaces
-------------------------------------------------------------------------
Register space         PCI
Register space         PCI #2
Register space         PCI Express, base address = 0x0F0000000
Register space         LPC, base address = 0x0CD0
Register space         SMBus, base address = 0x0B00

What can I do? Only SSE2?

Thanks

Philippe
32
Graphics programming / Re: Using GDI+
« Last post by HellOfMice on November 04, 2024, 08:28:45 PM »
I had thought to the QWORD but not at the padding bytes.
No problem Vortex you already are so nice to give one of your source.
I appreeciate
I will give you some news in the following days.


Thank You very much


Philippe
33
Graphics programming / Re: Using GDI+
« Last post by Vortex on November 04, 2024, 08:22:47 PM »
Hi Philippe,

Please accept my apologies, Timo is right and I corrected the definition of the structure :

Code: [Select]
GdiplusStartupInput STRUCT
    GdiplusVersion              DWORD ?
                                DWORD ? ; padding DWORD
    DebugEventCallback          QWORD ?
    SuppressBackgroundThread    DWORD ?
    SuppressExternalCodecs      DWORD ?
GdiplusStartupInput ENDS

New zip file uploaded at the top.
34
Graphics programming / Re: Using GDI+
« Last post by TimoVJL on November 04, 2024, 09:42:40 AM »
CALLBACK is QWORD size pointer in 64-bit code
Code: [Select]
typedef struct
{
    UINT32 GdiplusVersion ;
    void* DebugEventCallback ;
    BOOL SuppressBackgroundThread ;
    BOOL SuppressExternalCodecs ;
} GDIPLUSSTARTUPINPUT ;

EDIT:
Code: [Select]
GDIPLUSSTARTUPINPUT 16 10h bytes
GdiplusVersion   +0h 4h
DebugEventCallback +4h 4h
SuppressBackgroundThread +8h 4h
SuppressExternalCodecs +Ch 4h
Code: [Select]
GDIPLUSSTARTUPINPUT 24 18h bytes
GdiplusVersion   +0h 4h
DebugEventCallback +8h 8h
SuppressBackgroundThread +10h 4h
SuppressExternalCodecs +14h 4h
Code: [Select]
#define WIN32_LEAN_AND_MEAN
//#include <windows.h>
#include <richedit.h>
#include <stddef.h>
#include <stdio.h>
// http://www.catb.org/esr/structure-packing/
// http://stackoverflow.com/questions/1208954/c-struct-grabbing-data-by-offset
#ifndef offsetof
#define offsetof(ty,m)  ((size_t)&(((ty*)0)->m))
#endif
#define GET_FIELD_OFFSET(type, field)    ((size_t)&(((type *)0)->field))
#define GET_FIELD_SIZE(type, field)      (sizeof(((type *)0)->field))

#define PRINTSIZE(x)  printf("\n%-16s %d %Xh bytes\n",#x,sizeof(x),sizeof(x));
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));

typedef struct
{
    UINT32 GdiplusVersion ;
    void* DebugEventCallback ;
    BOOL SuppressBackgroundThread ;
    BOOL SuppressExternalCodecs ;
} GDIPLUSSTARTUPINPUT ;

int main(void)
{
PRINTSIZE(GDIPLUSSTARTUPINPUT);
PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,GdiplusVersion);
PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,DebugEventCallback);
PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressBackgroundThread);
PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressExternalCodecs);
return 0;
}
35
Graphics programming / Re: Using GDI+
« Last post by HellOfMice on November 04, 2024, 05:25:00 AM »
Hello Vortex

I have a problem calling GdiplusStartup, it crashes.
I copied from your source code which works well and mine crashes!

Could you help me please

Philippe RIO

Code: [Select]
includelib   "\Program Files\PellesC\Lib\Win64\GdiPlus.lib"

BITMAP STRUCT
  bmType        DWORD       ?
  bmWidth       DWORD       ?
  bmHeight      DWORD       ?
  bmWidthBytes  DWORD       ?
  bmPlanes      WORD        ?
  bmBitsPixel   WORD        ?
  padding       DWORD       ?
  bmBits        QWORD       ?
BITMAP ENDS

GdiplusStartupInput STRUCT
    GdiplusVersion              DWORD ?
    DebugEventCallback          DWORD ?                ;;   Should be QWORD I think
    SuppressBackgroundThread    DWORD ?
    SuppressExternalCodecs      DWORD ?
GdiplusStartupInput ENDS

GdipCreateBitmapFromFile   PROTO :QWORD,:QWORD
GdipCreateHBITMAPFromBitmap   PROTO :QWORD,:QWORD,:QWORD
GdipDisposeImage         PROTO :QWORD
GdiplusStartup            PROTO :QWORD,:QWORD,:QWORD
GdiplusShutdown            PROTO :QWORD

                     .Data?
StartupInfo               GdiplusStartupInput      <?>
GDIPlusToken            QWORD               ?         

                     .Code

                     ALIGN   16

UnicodeStr               PROC   Source:QWORD,Dest:QWORD PARMAREA=4*QWORD

                     xor      r8d,r8d
                     mov      r9d,1
                     xor      eax,eax
                     sub      rax,r9
@@:
                     add      rax,r9
                     mov      r8b,BYTE PTR [rcx + rax]
                     mov      WORD PTR [rdx + rax * 2],r8w

                     test   r8,r8
                     jnz      @b

                     ret
UnicodeStr               ENDP

GDIPlus_Init            PROC
                     mov      rax,OFFSET StartupInfo
                     mov      GdiplusStartupInput.GdiplusVersion[rax],1
                     mov      rcx,OFFSET GDIPlusToken
                     mov      rdx,OFFSET StartupInfo
                     xor      r8d,r8d
                     call   GdiplusStartup
;                     INVOKE   GdiplusStartup,ADDR GDIPlusToken,ADDR StartupInfo,0
                     ret
GDIPlus_Init            ENDP

GDIPlus_Exit            PROC
                     INVOKE   GdiplusShutdown,GDIPlusToken + rip
                     ret
GDIPlus_Exit            ENDP

GDIPlus_LoadFile         PROC   __hWnd:QWORD,__lpszFileName:QWORD PARMAREA=4*QWORD
                     LOCAL   _hBitmap:QWORD
                     LOCAL   _UniCodeFileName[64]:BYTE
                     LOCAL   _BmpImage:QWORD

                     INVOKE   UnicodeStr,__lpszFileName,ADDR _UniCodeFileName

                     INVOKE   GdipCreateBitmapFromFile,ADDR _UniCodeFileName,ADDR _BmpImage
                     INVOKE   GdipCreateHBITMAPFromBitmap,_BmpImage,ADDR _hBitmap,0

                     mov      rax,_hBitmap
                     ret
GDIPlus_LoadFile         ENDP

;   **********************************************************************************
;   *********************** F I N I S H E D **********************************************
;   **********************************************************************************

                     END
36
Graphics programming / Re: Using GDI+
« Last post by Vortex on November 03, 2024, 09:39:52 PM »
Hi HellOfMice,

Thanks, new upload at the top :

Code: [Select]
       invoke  GdipCreateHBITMAPFromBitmap,BmpImage,\
                ADDR hBitmap+rip,0

        invoke  GdipDisposeImage,BmpImage
       
        invoke  GdiplusShutdown,token
37
Graphics programming / Re: Using GDI+
« Last post by HellOfMice on November 03, 2024, 08:36:42 PM »
I am interfacing this example for making a standalone function
The GdiplusShutdown call is missing
38
Graphics programming / Re: Using GDI+
« Last post by Vortex on November 03, 2024, 08:33:27 PM »
Hi HellOfMice,

Here is an example for you :

Code: [Select]
    .if uMsg == WM_CREATE

        mov     rax,OFFSET StartupInfo
        mov     GdiplusStartupInput.GdiplusVersion[rax],1

        invoke  GdiplusStartup,ADDR token,ADDR StartupInfo,0
        invoke  UnicodeStr,ADDR filename,ADDR UnicodeFileName

        invoke  GdipCreateBitmapFromFile,ADDR UnicodeFileName,\
                ADDR BmpImage

        invoke  GdipGetImageWidth,BmpImage,ADDR ImgWidth+rip
        invoke  GdipGetImageHeight,BmpImage,ADDR ImgHeight+rip

        invoke  GdipCreateHBITMAPFromBitmap,BmpImage,\
                ADDR hBitmap+rip,0

        invoke  GdipDisposeImage,BmpImage
39
Graphics programming / Using GDI+
« Last post by HellOfMice on November 03, 2024, 06:32:21 PM »
Hello the World

I load ab image using the flat api of GDI+ with GdipLoadImageFromFileICM(_wFileName,&_Image) or with GdipCreateHBITMAPFromBitmap(GdiPlusBitmap,&_hBitmap,0) ; and I would like to get a BITMAPINFOHEADER or a BITMAPV5HEADER from the GpImage or the GpBitmap.

With the HBITMAP given by GdipCreateHBITMAPFromBitmap if I call GetObject this function returns 0.
My solution is to call GdipLoadImageFromFileICM(_wFileName,&_Image) and retrieve the with and the height with GdipGetImageWidth and GdipGetImageHeight the frees the image and call GDIPlus_GetHBitmapFromFile to get the hbitmap. After I can initialize a BITMAPINFO structure and call GetDIBits.

Is there a better way to do that? If I can get a BITMAPINFOHEADER structure it is good I know how to do after. I don't want to load the file twice.

Please could you help me.

Thank You

Philippe RIO
40
User contributions / Re: Session Traversal Utilities for NAT (STUN) - Client
« Last post by TimoVJL on November 02, 2024, 10:58:38 AM »
it's just size_t / sizeof issue in C macro ?
struct size is less than DWORD max.
Pages: 1 2 3 [4] 5 6 ... 10