¿ìËÙÒµÎñͨµÀ

WindowsµÄ¶¯Ì¬Á´½Ó¿âÔ­Àí¼°Ê¹ÓÃ2

×÷Õß ØýÃû¼¼Êõ À´Ô´ ³ÌÐòÉè¼Æ ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-30

3¡¡ÀûÓÃDLLsʵÏÖÊý¾Ý´«Êä

3.1 DLLsÖеÄÈ«¾ÖÄÚ´æ

Windows¹æ¶¨£ºDLLs²¢²»ÓµÓÐËü´ò¿ªµÄÈκÎÎļþ»òËü·ÖÅäµÄÈκÎÈ«¾ÖÄÚ´æ¿é¡£ÕâЩ¶ÔÏóÓÉÖ±½Ó»ò¼ä½Óµ÷ÓÃDLLsµÄÓ¦ÓóÌÐòÓµÓС£ÕâÑù£¬µ±Ó¦ÓóÌÐòÖÐֹʱ£¬ËüÓµÓеĴò¿ªµÄÎļþ×Ô¶¯¹Ø±Õ£¬ËüÓµÓеÄÈ«¾ÖÄÚ´æ¿é×Ô¶¯ÊÍ·Å¡£Õâ¾ÍÒâζ×ű£´æÔÚDLLsÈ«¾Ö±äÁ¿ÖеÄÎļþºÍÈ«¾ÖÄÚ´æ¿é±äÁ¿ÔÚDLLs

ûÓб»Í¨ÖªµÄÇé¿öϾͱäΪ·Ç·¨¡£Õ⽫¸øÆäËüʹÓøÃDLLsµÄÓ¦ÓóÌÐòÔì³ÉÀ§ÄÑ¡£

ΪÁ˱ÜÃâ³öÏÖÕâÖÖÇé¿ö£¬ÎļþºÍÈ«¾ÖÄÚ´æ¿é¾ä±ú²»Ó¦×÷ΪDLLsµÄÈ«¾Ö±äÁ¿£¬¶øÊÇ×÷ΪDLLsÖйý³Ì»òº¯ÊýµÄ²ÎÊý´«µÝ¸øDLLsʹÓᣵ÷ÓÃDLLsµÄÓ¦ÓóÌÐòÓ¦¸Ã¸ºÔð¶ÔËüÃǵÄά»¤¡£

µ«ÔÚÌض¨Çé¿öÏ£¬DLLsÒ²¿ÉÒÔÓµÓÐ×Ô¼ºµÄÈ«¾ÖÄÚ´æ¿é¡£ÕâЩÄÚ´æ¿é±ØÐëÓÃgmem_DDEShareÊôÐÔ½øÐзÖÅä¡£ÕâÑùµÄÄÚ´æ¿éÖ±µ½±»DLLsÏÔʾÊÍ·Å»òDLLsÍ˳öʱ¶¼±£³ÖÓÐЧ¡£

ÓÉDLLs¹ÜÀíµÄÈ«¾ÖÄÚ´æ¿éÊÇÓ¦ÓóÌÐò¼ä½øÐÐÊý¾Ý´«ÊäµÄÓÖһ;¾¶£¬ÏÂÃæÎÒÃǽ«×¨ÃÅÌÖÂÛÕâÒ»ÎÊÌâ¡£

3.2 ÀûÓÃDLLsʵÏÖÓ¦ÓóÌÐò¼äµÄÊý¾Ý´«Êä

ÀûÓÃDLLsʵÏÖÓ¦ÓóÌÐò¼äµÄÊý¾Ý´«ÊäµÄ²½ÖèΪ£º

1. ±àдһ¸öDLLs³ÌÐò£¬ÆäÖÐÓµÓÐÒ»¸öÓÃgmem_DDEShareÊôÐÔ·ÖÅäµÄÈ«¾ÖÄÚ´æ¿é£»

2. ·þÎñÆ÷³ÌÐòµ÷ÓÃDLLs£¬ÏòÈ«¾ÖÄÚ´æ¿éдÈëÊý¾Ý£»

3. ¿Í»§³ÌÐòµ÷ÓÃDLLs£¬´ÓÈ«¾ÖÄÚ´æ¿é¶ÁÈ¡Êý¾Ý¡£

3.2.1¡¡ÓÃÓÚʵÏÖÊý¾Ý´«ÊäµÄDLLsµÄ±àд

ÓÃÓÚʵÏÖÊý¾Ý´«ÊäµÄDLLsÓëÒ»°ãDLLsµÄ±àд»ù±¾Ïàͬ£¬ÆäÖÐÌرðµÄµØ·½ÊÇ£º

1. ¶¨ÒåÒ»¸öÈ«¾Ö±äÁ¿¾ä±ú£º

¡¡¡¡¡¡¡¡var
¡¡¡¡¡¡¡¡¡¡ hMem: THandle;

2. ¶¨ÒåÒ»¸ö¹ý³Ì£¬·µ»Ø¸ÃÈ«¾Ö±äÁ¿µÄ¾ä±ú¡£¸Ã¹ý³ÌÒª°üº¬ÔÚexports×Ó¾äÖС£È磺

¡¡¡¡¡¡¡¡function GetGlobalMem: THandle; export;
¡¡¡¡¡¡¡¡ begin
¡¡¡¡¡¡¡¡¡¡ Result := hMem;
¡¡¡¡¡¡¡¡ end;

3. ÔÚ³õʼ»¯´úÂëÖзÖÅäÈ«¾ÖÄÚ´æ¿é£º

³ÌÐòÇåµ¥ÈçÏ£º

¡¡¡¡¡¡¡¡begin
¡¡¡¡¡¡¡¡¡¡ hMem := GlobalAlloc(gmem_MOVEABLE and gmem_DDEShare,num);
¡¡¡¡¡¡¡¡¡¡ if hMem = 0 then
¡¡¡¡¡¡¡¡¡¡¡¡  MessageDlg(''Could not allocate memory'',mtWarning,[mbOK],0);
¡¡¡¡¡¡¡¡ end.

numÊÇÒ»¸öÔ¤¶¨ÒåµÄ³£Êý¡£

Windows APIº¯ÊýGlobalAllocÓÃÓÚ´ÓÈ«¾ÖÄÚ´æ¶ÑÖзÖÅäÒ»¿éÄڴ棬²¢·µ»Ø¸ÃÄÚ´æ¿éµÄ¾ä±ú¡£¸Ãº¯Êý°üÀ¨Á½¸ö²ÎÊý£¬µÚÒ»¸ö²ÎÊýÓÃÓÚÉèÖÃÄÚ´æ¿éµÄ·ÖÅä±êÖ¾¡£¿ÉÒÔʹÓõķÖÅä±êÖ¾ÈçϱíËùʾ¡£

±í3¡¡È«¾ÖÄÚ´æ¿éµÄ·ÖÅä±êÖ¾

©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥

±ê¡¡¡¡¡¡Ö¾¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Òâ¡¡¡¡¡¡Òå

---------------------------------

gmem_DDEShare¡¡¡¡¡¡¡¡¡¡ ·ÖÅä¿ÉÓÉÓ¦ÓóÌÐò¹²ÏíµÄÄÚ´æ

gmem_Discardable¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·ÖÅä¿ÉÅ×ÆúµÄÄÚ´æ(Ö»Óëgmem_MoveableÁ¬ÓÃ)

gmem_Fixed¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡·ÖÅä¹Ì¶¨ÄÚ´æ

gmem_Moveable¡¡¡¡¡¡¡¡¡¡ ·ÖÅä¿ÉÒƶ¯µÄÄÚ´æ

gmem_Nocompact¡¡¡¡¡¡¡¡¡¡¸ÃÈ«¾Ö¶ÑÖеÄÄÚ´æ²»Äܱ»Ñ¹Ëõ»òÅ×Æú

gmem_Nodiscard¡¡¡¡¡¡¡¡¡¡¸ÃÈ«¾Ö¶ÑÖеÄÄÚ´æ²»Äܱ»Å×Æú

gmem_NOT_Banked ·ÖÅä²»Äܱ»·Ö¶ÎµÄÄÚ´æ

gmem_Notify¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Í¨Öª¹¦ÄÜ¡£µ±¸ÃÄÚ´æ±»Å×Æúʱµ÷ÓÃGlobalNotifyº¯Êý

gmem_Zeroinit¡¡¡¡¡¡¡¡¡¡ ½«Ëù·ÖÅäÄÚ´æ¿éµÄÄÚÈݳõʼ»¯ÎªÁã

©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥

ÓÐÁ½¸öÔ¤¶¨ÒåµÄ³£ÓÃ×éºÏÊÇ£º

GHND¡¡=¡¡gmem_Moveable and gmem_Zeroinit

GPTK¡¡=¡¡gmem_Fixed and gmem_Zeroinit

µÚ¶þ¸ö²ÎÊýÓÃÓÚÉèÖÃÓû·ÖÅäµÄ×Ö½ÚÊý¡£·ÖÅäµÄ×Ö½ÚÊý±ØÐëÊÇ32µÄ±¶Êý£¬Òò¶øʵ¼Ê·ÖÅäµÄ×Ö½ÚÊý¿ÉÄܱÈËùÉèÖõÄÒª´ó¡£

ÓÉÓÚÓÃgmem_DDEShare·ÖÅäµÄÄÚ´æÔÚ·ÖÅäÄÚ´æµÄÄ£¿éÖÕֹʱ×Ô¶¯Å×Æú£¬Òò¶ø²»±Øµ÷ÓÃGlobalFreeÏÔʽÊÍ·ÅÄÚ´æ¡£

3.2.2¡¡·þÎñÆ÷³ÌÐòµÄ±àд

·þÎñÆ÷³ÌÐò±ØÐë°üº¬¶ÔDLLµÄµ÷ÓôúÂ룬È磺

function GetGlobalMem: THandle; far; external ''c:\dlls\glbmem'';

ͨ¹ýµ÷Óøú¯Êý£¬·þÎñÆ÷¿ÉÒÔ»ñµÃÈ«¾ÖÄÚ

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à
HTTP/1.1 401 Access Denied ¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ