{"id":606,"date":"2008-05-16T06:19:13","date_gmt":"2008-05-16T06:19:13","guid":{"rendered":"http:\/\/6teen.ru\/?p=350"},"modified":"2008-05-16T06:19:13","modified_gmt":"2008-05-16T06:19:13","slug":"8713","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=606","title":{"rendered":"\u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 DLL"},"content":{"rendered":"<p>\u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 DLL<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 DLL\n\n\u0412\u044b\u0431\u0438\u0440\u0430\u044e \u0432\u0441\u0435 dll \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439,\n\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e \u043a\u0430\u0436\u0434\u0443\u044e \u0438 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0432 \u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u0447\u0435\u0440\u0435\u0437 api getprocaddress)\n\u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0436\u0435\u0441\u0442\u043a\u043e \u0438\u043c\u0435\u043d\u0435\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0447\u0442\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u0442\u0438\u043f\u0430 ispluginformystuff).\n\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0430\u0441\u044c - dll \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 - \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0437\u0430\u0431\u044b\u0442\u044c.\n\n\u0410 \u043d\u0430\u0431\u043e\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e \u0438\u0434\u0435\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432 \u0443 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432,\n\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 (\u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f) \u0432 \u043a\u0443\u0440\u0441\u0435 \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043d\u0430 \u0438\u0449\u0435\u0442 \u0432 dll.\n\u0415\u0441\u043b\u0438 \u0434\u0430\u0436\u0435 \u0438 \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0442\u0435\u0431\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 getfeatures,\n\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u043e\u043a-\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440.\n--------------------------------------------------------------------------------\n...\ntype\n\n\/\/ \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432\ntgetnproc=function:shortstring;\ntgetsproc=function:integer;\ntprocessproc=procedure(config:pointer; request:prequest; var reply:preply);\ntconfigproc=procedure(defcfg:psysconfig; var config:pointer);\ntsaveloadproc=procedure(inifile:pointer; var config:pointer);\n\n\n\/\/ \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435\ntplugin=record\nname:shortstring; \/\/ \u041f\u043e\u043b\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\nfilename:shortstring; \/\/ \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430\nhandle:integer; \/\/ \u0425\u044d\u043d\u0434\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 dll\ncfgsize:integer; \/\/ \u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 ram\nprocessproc: tprocessproc; \/\/ \u0410\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438\nconfigproc: tconfigproc; \/\/ \u0410\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\nloadcfg,savecfg:tsaveloadproc; \/\/ \u0410\u0434\u0440\u0435\u0441\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 cfg\nend;\npplugin=^tplugin;\n\n\n\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432\ntplugins=class(tlist);\n\n...\n\nvar\n\nplugins:tplugins; sr:tsearchrec; lib:integer;\npgetn:tgetnproc; pgets: tgetsproc; plugin:pplugin;\n\n...\n\n\/\/ \u0427\u0438\u0442\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u0445 \u0441\u043f\u0438\u0441\u043e\u043a.\nplugins:=tplugins.create;\nif findfirst('*.dll',faanyfile,sr)< > 0 then begin\n\nshowmessage('h\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.');\nclose;\nend;\nrepeat\n\nlib:=loadlibrary(pchar(sr.name));\nif lib< > 0 then begin\n@pgetn:=getprocaddress(lib, 'getpluginname');\nif @pgetn=nil then freelibrary(lib) \/\/ h\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\nelse begin\nnew(plugin);\n@pgets:=getprocaddress(lib, 'getcfgsize');\nplugin.name:=pgetn;\nplugin.filename:=sr.name;\nplugin.cfgsize:=pgets;\nplugin.handle:=lib;\nplugin.configproc:=getprocaddress(lib, 'configure');\nplugin.processproc:=getprocaddress(lib, 'process');\nplugin.savecfg:=getprocaddress(lib, 'savecfg');\nplugin.loadcfg:=getprocaddress(lib, 'loadcfg');\nplugins.add(plugin);\nend;\nend;\nuntil findnext(sr)< > 0;\nfindclose(sr);\n...\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 DLL<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,402],"tags":[1907,1509,1035],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/606"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=606"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/606\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=606"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}